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

urplay: add support for the new site

some help from @unayok
This commit is contained in:
Johan Andersson 2013-02-14 23:42:30 +01:00
parent db85d3ede7
commit 3007584c39

View File

@ -663,11 +663,22 @@ class Urplay():
def get(self, options, url): def get(self, options, url):
data = get_http_data(url) data = get_http_data(url)
match = re.search('file=(.*)\&plugins', data) data = re.search("urPlayer.init\((.*)\);", data)
if match: data = re.sub("(\w+): ", r'"\1":',data.group(1))
path = "mp%s:%s" % (match.group(1)[-1], match.group(1)) data = data.replace("\'", "\"").replace("\",}","\"}").replace("(m = location.hash.match(/[#&]start=(\d+)/)) ? m[1] : 0,","0")
options.other = "-a ondemand -y %s" % path jsondata = json.loads(data)
download_rtmp(options, "rtmp://streaming.ur.se/") basedomain = jsondata["streaming_config"]["streamer"]["redirect"]
http = "http://%s/%s" % (basedomain, jsondata["file_html5"])
hds = "%s%s" % (http, jsondata["streaming_config"]["http_streaming"]["hds_file"])
hls = "%s%s" % (http, jsondata["streaming_config"]["http_streaming"]["hls_file"])
rtmp = "rtmp://%s/%s" % (basedomain, jsondata["streaming_config"]["rtmp"]["application"])
path = "mp%s:%s" % (jsondata["file_flash"][-1], jsondata["file_flash"])
options.other = "-v -a %s -y %s" % (jsondata["streaming_config"]["rtmp"]["application"], path)
if options.hls:
download_hls(options, hls, http)
if jsondata["file_flash"][-1] == "3":
download_rtmp(options, rtmp)
download_hds(options, hds)
class Qbrick(): class Qbrick():
def handle(self, url): def handle(self, url):