From 507cf21e3d2bd4f15d339dc9a552ee81ca4ece3d Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Mon, 23 Jun 2014 21:22:26 +0200 Subject: [PATCH] tv4play: hds live videos looks a bit different from vod hds. --- lib/svtplay_dl/service/tv4play.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/svtplay_dl/service/tv4play.py b/lib/svtplay_dl/service/tv4play.py index af1e2b2..8caf0e6 100644 --- a/lib/svtplay_dl/service/tv4play.py +++ b/lib/svtplay_dl/service/tv4play.py @@ -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]