1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

tv4play: hds live videos looks a bit different from vod hds.

This commit is contained in:
Johan Andersson 2014-06-23 21:22:26 +02:00
parent abaf1e19a9
commit 507cf21e3d

View File

@ -59,13 +59,17 @@ class Tv4play(Service, OpenGraphThumbMixin):
sys.exit(2)
for i in sa:
if i.find("mediaFormat").text == "mp4":
base = i.find("base").text
if base[0:4] == "rtmp":
base = urlparse(i.find("base").text)
parse = urlparse(i.find("url").text)
if base.scheme == "rtmp":
swf = "http://www.tv4play.se/flash/tv4playflashlets.swf"
options.other = "-W %s -y %s" % (swf, i.find("url").text)
yield RTMP(copy.copy(options), i.find("base").text, i.find("bitrate").text)
elif base[len(base)-3:len(base)] == "f4m":
manifest = "%s?hdcore=2.8.0&g=hejsan" % i.find("url").text
elif parse.path[len(parse.path)-3:len(parse.path)] == "f4m":
query = ""
if i.find("url").text[-1] != "?":
query = "?"
manifest = "%s%shdcore=2.8.0&g=hejsan" % (i.find("url").text, query)
streams = hdsparse(copy.copy(options), manifest)
for n in list(streams.keys()):
yield streams[n]