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

tv4play: check html data before url.

This commit is contained in:
Johan Andersson 2014-08-31 00:36:19 +02:00
parent cbbe997311
commit 46d5279bf8

View File

@ -33,15 +33,15 @@ class Tv4play(Service, OpenGraphThumbMixin):
log.error("Can't find video file")
sys.exit(2)
else:
match = re.search(r"-(\d+)$", self.url)
match = re.search(r"\"vid\":\"(\d+)\",", self.get_urldata())
if match:
vid = match.group(1)
else:
match = re.search(r"\"vid\":\"(\d+)\",", self.get_urldata())
match = re.search(r"-(\d+)$", self.url)
if match:
vid = match.group(1)
else:
log.error("Can't find video file")
log.error("Can't find video id")
sys.exit(2)
url = "http://premium.tv4play.se/api/web/asset/%s/play" % vid