From 1e6de72d64517f4a1749502cf6f0315fa5e81e87 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 6 Sep 2015 23:04:48 +0200 Subject: [PATCH] Better excluding message fixing #198 --- lib/svtplay_dl/service/aftonbladet.py | 1 + lib/svtplay_dl/service/bambuser.py | 1 + lib/svtplay_dl/service/bigbrother.py | 1 + lib/svtplay_dl/service/dbtv.py | 1 + lib/svtplay_dl/service/disney.py | 1 + lib/svtplay_dl/service/dr.py | 1 + lib/svtplay_dl/service/expressen.py | 1 + lib/svtplay_dl/service/hbo.py | 1 + lib/svtplay_dl/service/kanal5.py | 1 + lib/svtplay_dl/service/lemonwhale.py | 1 + lib/svtplay_dl/service/mtvnn.py | 1 + lib/svtplay_dl/service/mtvservices.py | 1 + lib/svtplay_dl/service/nrk.py | 1 + lib/svtplay_dl/service/picsearch.py | 1 + lib/svtplay_dl/service/qbrick.py | 1 + lib/svtplay_dl/service/radioplay.py | 1 + lib/svtplay_dl/service/ruv.py | 1 + lib/svtplay_dl/service/sr.py | 1 + lib/svtplay_dl/service/svtplay.py | 1 + lib/svtplay_dl/service/tv4play.py | 1 + lib/svtplay_dl/service/twitch.py | 1 + lib/svtplay_dl/service/urplay.py | 1 + lib/svtplay_dl/service/vg.py | 1 + lib/svtplay_dl/service/viaplay.py | 1 + lib/svtplay_dl/service/vimeo.py | 1 + lib/svtplay_dl/service/youplay.py | 1 + 26 files changed, 26 insertions(+) diff --git a/lib/svtplay_dl/service/aftonbladet.py b/lib/svtplay_dl/service/aftonbladet.py index 6de6e3c..63dd495 100644 --- a/lib/svtplay_dl/service/aftonbladet.py +++ b/lib/svtplay_dl/service/aftonbladet.py @@ -17,6 +17,7 @@ class Aftonbladet(Service): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search('data-aptomaId="([-0-9a-z]+)"', data) diff --git a/lib/svtplay_dl/service/bambuser.py b/lib/svtplay_dl/service/bambuser.py index 17ee60b..2d6b023 100644 --- a/lib/svtplay_dl/service/bambuser.py +++ b/lib/svtplay_dl/service/bambuser.py @@ -20,6 +20,7 @@ class Bambuser(Service, OpenGraphThumbMixin): return if self.exclude(options): + yield ServiceError("Excluding video") return json_url = "http://player-c.api.bambuser.com/getVideo.json?api_key=005f64509e19a868399060af746a00aa&vid=%s" % match.group(1) diff --git a/lib/svtplay_dl/service/bigbrother.py b/lib/svtplay_dl/service/bigbrother.py index 14c9d34..d9fea85 100644 --- a/lib/svtplay_dl/service/bigbrother.py +++ b/lib/svtplay_dl/service/bigbrother.py @@ -17,6 +17,7 @@ class Bigbrother(Service, OpenGraphThumbMixin): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search(r'id="(bcPl[^"]+)"', data) diff --git a/lib/svtplay_dl/service/dbtv.py b/lib/svtplay_dl/service/dbtv.py index d1dcae7..bb9d9ee 100644 --- a/lib/svtplay_dl/service/dbtv.py +++ b/lib/svtplay_dl/service/dbtv.py @@ -16,6 +16,7 @@ class Dbtv(Service, OpenGraphThumbMixin): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return parse = urlparse(self.url) diff --git a/lib/svtplay_dl/service/disney.py b/lib/svtplay_dl/service/disney.py index 986a982..60a6bfb 100644 --- a/lib/svtplay_dl/service/disney.py +++ b/lib/svtplay_dl/service/disney.py @@ -23,6 +23,7 @@ class Disney(Service, OpenGraphThumbMixin): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search(r"Grill.burger=({.*}):", data) diff --git a/lib/svtplay_dl/service/dr.py b/lib/svtplay_dl/service/dr.py index 30db589..6ffeb1e 100644 --- a/lib/svtplay_dl/service/dr.py +++ b/lib/svtplay_dl/service/dr.py @@ -19,6 +19,7 @@ class Dr(Service, OpenGraphThumbMixin): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search(r'resource:[ ]*"([^"]*)",', data) diff --git a/lib/svtplay_dl/service/expressen.py b/lib/svtplay_dl/service/expressen.py index 15ecb80..80cdf81 100644 --- a/lib/svtplay_dl/service/expressen.py +++ b/lib/svtplay_dl/service/expressen.py @@ -20,6 +20,7 @@ class Expressen(Service): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search("xmlUrl=([^ ]+)\" ", data) diff --git a/lib/svtplay_dl/service/hbo.py b/lib/svtplay_dl/service/hbo.py index 831c263..c35fdc3 100644 --- a/lib/svtplay_dl/service/hbo.py +++ b/lib/svtplay_dl/service/hbo.py @@ -23,6 +23,7 @@ class Hbo(Service): return if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search("^/(.*).html", other) diff --git a/lib/svtplay_dl/service/kanal5.py b/lib/svtplay_dl/service/kanal5.py index 7ec59d4..8039dd9 100644 --- a/lib/svtplay_dl/service/kanal5.py +++ b/lib/svtplay_dl/service/kanal5.py @@ -63,6 +63,7 @@ class Kanal5(Service): options.output = title if self.exclude(options): + yield ServiceError("Excluding video") return if data["hasSubtitle"]: diff --git a/lib/svtplay_dl/service/lemonwhale.py b/lib/svtplay_dl/service/lemonwhale.py index fb3220e..f0bba3e 100644 --- a/lib/svtplay_dl/service/lemonwhale.py +++ b/lib/svtplay_dl/service/lemonwhale.py @@ -18,6 +18,7 @@ class Lemonwhale(Service): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search(r'video url-([^"]+)', data) diff --git a/lib/svtplay_dl/service/mtvnn.py b/lib/svtplay_dl/service/mtvnn.py index 2c18a03..f61f01e 100644 --- a/lib/svtplay_dl/service/mtvnn.py +++ b/lib/svtplay_dl/service/mtvnn.py @@ -32,6 +32,7 @@ class Mtvnn(Service, OpenGraphThumbMixin): options.output = title if self.exclude(options): + yield ServiceError("Excluding video") return swfurl = mediagen.find("{http://search.yahoo.com/mrss/}player").attrib["url"] diff --git a/lib/svtplay_dl/service/mtvservices.py b/lib/svtplay_dl/service/mtvservices.py index 701ab02..789994a 100644 --- a/lib/svtplay_dl/service/mtvservices.py +++ b/lib/svtplay_dl/service/mtvservices.py @@ -32,6 +32,7 @@ class Mtvservices(Service): sa = list(ss.iter("rendition")) if self.exclude(options): + yield ServiceError("Excluding video") return for i in sa: diff --git a/lib/svtplay_dl/service/nrk.py b/lib/svtplay_dl/service/nrk.py index ebd319b..0e8143b 100644 --- a/lib/svtplay_dl/service/nrk.py +++ b/lib/svtplay_dl/service/nrk.py @@ -19,6 +19,7 @@ class Nrk(Service, OpenGraphThumbMixin): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search("data-subtitlesurl = \"(/.*)\"", data) diff --git a/lib/svtplay_dl/service/picsearch.py b/lib/svtplay_dl/service/picsearch.py index 0cafae6..332cbd0 100644 --- a/lib/svtplay_dl/service/picsearch.py +++ b/lib/svtplay_dl/service/picsearch.py @@ -17,6 +17,7 @@ class Picsearch(Service, OpenGraphThumbMixin): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return ajax_auth = re.search(r"picsearch_ajax_auth = '(\w+)'", data) diff --git a/lib/svtplay_dl/service/qbrick.py b/lib/svtplay_dl/service/qbrick.py index 6696aab..995cf60 100644 --- a/lib/svtplay_dl/service/qbrick.py +++ b/lib/svtplay_dl/service/qbrick.py @@ -17,6 +17,7 @@ class Qbrick(Service, OpenGraphThumbMixin): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return if re.findall(r"di.se", self.url): diff --git a/lib/svtplay_dl/service/radioplay.py b/lib/svtplay_dl/service/radioplay.py index 3cd882d..ae36696 100644 --- a/lib/svtplay_dl/service/radioplay.py +++ b/lib/svtplay_dl/service/radioplay.py @@ -19,6 +19,7 @@ class Radioplay(Service): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search(r"RP.vcdData = ({.*});", data) diff --git a/lib/svtplay_dl/service/ruv.py b/lib/svtplay_dl/service/ruv.py index 466a86d..061029e 100644 --- a/lib/svtplay_dl/service/ruv.py +++ b/lib/svtplay_dl/service/ruv.py @@ -17,6 +17,7 @@ class Ruv(Service): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search(r'"([^"]+geo.php)"', data) diff --git a/lib/svtplay_dl/service/sr.py b/lib/svtplay_dl/service/sr.py index 79615e6..eb1e7e4 100644 --- a/lib/svtplay_dl/service/sr.py +++ b/lib/svtplay_dl/service/sr.py @@ -21,6 +21,7 @@ class Sr(Service, OpenGraphThumbMixin): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search(r'href="(/sida/[\.\/=a-z0-9&;\?]+playaudio=\d+)"', data) diff --git a/lib/svtplay_dl/service/svtplay.py b/lib/svtplay_dl/service/svtplay.py index e4f2ac0..7bd92f0 100644 --- a/lib/svtplay_dl/service/svtplay.py +++ b/lib/svtplay_dl/service/svtplay.py @@ -60,6 +60,7 @@ class Svtplay(Service, OpenGraphThumbMixin): options.output = outputfilename(data, options.output, ensure_unicode(self.get_urldata())) if self.exclude(options): + yield ServiceError("Excluding video") return if data["video"]["subtitleReferences"]: diff --git a/lib/svtplay_dl/service/tv4play.py b/lib/svtplay_dl/service/tv4play.py index 4d70143..04c3e7e 100644 --- a/lib/svtplay_dl/service/tv4play.py +++ b/lib/svtplay_dl/service/tv4play.py @@ -87,6 +87,7 @@ class Tv4play(Service, OpenGraphThumbMixin): options.output = title if self.exclude(options): + yield ServiceError("Excluding video") return for i in sa: diff --git a/lib/svtplay_dl/service/twitch.py b/lib/svtplay_dl/service/twitch.py index 436ac1e..f6435e5 100644 --- a/lib/svtplay_dl/service/twitch.py +++ b/lib/svtplay_dl/service/twitch.py @@ -48,6 +48,7 @@ class Twitch(Service): urlp = urlparse(self.url) if self.exclude(options): + yield ServiceError("Excluding video") return match = re.match(r'/(\w+)/([bcv])/(\d+)', urlp.path) diff --git a/lib/svtplay_dl/service/urplay.py b/lib/svtplay_dl/service/urplay.py index 0bad643..da4a145 100644 --- a/lib/svtplay_dl/service/urplay.py +++ b/lib/svtplay_dl/service/urplay.py @@ -29,6 +29,7 @@ class Urplay(Service, OpenGraphThumbMixin): return if self.exclude(options): + yield ServiceError("Excluding video") return data = match.group(1) diff --git a/lib/svtplay_dl/service/vg.py b/lib/svtplay_dl/service/vg.py index d15a137..afc2f16 100644 --- a/lib/svtplay_dl/service/vg.py +++ b/lib/svtplay_dl/service/vg.py @@ -38,6 +38,7 @@ class Vg(Service, OpenGraphThumbMixin): options.output = title if self.exclude(options): + yield ServiceError("Excluding video") return if "hds" in jsondata["streamUrls"]: diff --git a/lib/svtplay_dl/service/viaplay.py b/lib/svtplay_dl/service/viaplay.py index bc33e55..f3ad275 100644 --- a/lib/svtplay_dl/service/viaplay.py +++ b/lib/svtplay_dl/service/viaplay.py @@ -70,6 +70,7 @@ class Viaplay(Service, OpenGraphThumbMixin): options.live = True if self.exclude(options): + yield ServiceError("Excluding video") return if dataj["sami_path"]: diff --git a/lib/svtplay_dl/service/vimeo.py b/lib/svtplay_dl/service/vimeo.py index d56a8cf..7029505 100644 --- a/lib/svtplay_dl/service/vimeo.py +++ b/lib/svtplay_dl/service/vimeo.py @@ -16,6 +16,7 @@ class Vimeo(Service, OpenGraphThumbMixin): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search('data-config-url="([^"]+)" data-fallback-url', data) diff --git a/lib/svtplay_dl/service/youplay.py b/lib/svtplay_dl/service/youplay.py index 4e3ddf5..fd9e64f 100644 --- a/lib/svtplay_dl/service/youplay.py +++ b/lib/svtplay_dl/service/youplay.py @@ -17,6 +17,7 @@ class Youplay(Service, OpenGraphThumbMixin): data = self.get_urldata() if self.exclude(options): + yield ServiceError("Excluding video") return match = re.search(r'script async defer src="(//content.youplay.se[^"]+)"', data)