From f50ef910be5f7af865244c098e696cf60c92915f Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Mon, 10 Feb 2014 21:58:26 +0100 Subject: [PATCH] Skip CyanideAndHappiness videos --- dosagelib/plugins/c.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/dosagelib/plugins/c.py b/dosagelib/plugins/c.py index c9b07ebfd..c5d85035d 100755 --- a/dosagelib/plugins/c.py +++ b/dosagelib/plugins/c.py @@ -99,7 +99,7 @@ class CatAndGirl(_BasicScraper): prevSearch = compile(tagre("a", "href", r'([^"]+)')+r"[^<]+Previous") help = 'Index format: n (unpadded)' - def shouldSkipUrl(self, url): + def shouldSkipUrl(self, url, data): """Skip pages without images.""" return url in ( self.stripUrl % '4299', @@ -403,7 +403,7 @@ class Curvy(_BasicScraper): compile(tagre("a", "href", r'(/\?date=\d+)') + tagre("img", "src", "/nav/next\.png"))) - def shouldSkipUrl(self, url): + def shouldSkipUrl(self, url, data): """Skip pages without images.""" return url in ( self.stripUrl % '20130402', @@ -419,15 +419,9 @@ class CyanideAndHappiness(_BasicScraper): prevSearch = compile(tagre("a", "href", r'(/comics/\d+/)', before="prev")) help = 'Index format: n (unpadded)' - def shouldSkipUrl(self, url): + def shouldSkipUrl(self, url, data): """Skip pages without images.""" - return url in ( - self.stripUrl % "3082", - self.stripUrl % "3360", # video - self.stripUrl % "3367", # video - self.stripUrl % "3382", # video - self.stripUrl % "3421", # video - ) + return "/comics/play-button.png" in data @classmethod def namer(cls, imageUrl, pageUrl):