From 46d5279bf8e163c35e5613ca88d6460fcfbfbbdd Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 31 Aug 2014 00:36:19 +0200 Subject: [PATCH] tv4play: check html data before url. --- lib/svtplay_dl/service/tv4play.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/svtplay_dl/service/tv4play.py b/lib/svtplay_dl/service/tv4play.py index 347127d..f2e03e1 100644 --- a/lib/svtplay_dl/service/tv4play.py +++ b/lib/svtplay_dl/service/tv4play.py @@ -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