From 96fc129fea3ad50521ef19ed572bdccffcd0937e Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 25 Apr 2013 20:54:48 +0200 Subject: [PATCH] Add GeneralProtectionFault (disallowed by robots.txt) --- dosagelib/plugins/g.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dosagelib/plugins/g.py b/dosagelib/plugins/g.py index b00932b8c..4a003074f 100644 --- a/dosagelib/plugins/g.py +++ b/dosagelib/plugins/g.py @@ -64,6 +64,25 @@ class GeeksNextDoor(_BasicScraper): help = 'Index format: yyyy-mm-dd' +# disallowed by robots.txt +class _GeneralProtectionFault(_BasicScraper): + description = u'General Protection Fault' + url = 'http://www.gpf-comics.com/' + rurl = escape(url) + stripUrl = url + 'archive/%s' + firstStripUrl = stripUrl % '1998/11/02' + imageSearch = compile(tagre("img", "src", r'(/comics/[^"]*)')) + prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl) + + tagre("img", "alt", "Previous Comic")) + help = 'Index format: yyyy/mm/dd' + + @classmethod + def namer(cls, imageUrl, pageUrl): + """Remove random stuff from filename.""" + imageName = imageUrl.split('/')[-1] + return imageName[:11] + imageName[-4:] + + class GirlsWithSlingshots(_BasicScraper): url = 'http://www.girlswithslingshots.com/' rurl = escape(url)