1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

Svtplay: automagic get the right .swf file

This commit is contained in:
Johan Andersson 2012-07-28 16:38:12 +02:00
parent c3c7b18f1b
commit f155eba822

View File

@ -19,7 +19,7 @@ import json
import time import time
import logging import logging
__version__ = "0.7.2012.07.27" __version__ = "0.7.2012.07.28"
def get_http_data(url, method="GET", header="", data=""): def get_http_data(url, method="GET", header="", data=""):
""" Get the page to parse it for streams """ """ Get the page to parse it for streams """
@ -509,9 +509,12 @@ class Svtplay():
self.resume = resume self.resume = resume
def get(self, url): def get(self, url):
url = url + "?type=embed&output=json" url = url + "?type=embed"
data = get_http_data(url)
match = re.search("value=\"(/public/swf/video/svtplayer-[0-9\.]+swf)\"", data)
other = "-W http://www.svtplay.se" + match.group(1)
url = url + "&output=json"
data = json.loads(get_http_data(url)) data = json.loads(get_http_data(url))
other = "-W http://www.svtplay.se/public/swf/video/svtplayer-2012.28.swf"
self.live = data["video"]["live"] self.live = data["video"]["live"]
streams = {} streams = {}