# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam from re import compile, escape, IGNORECASE from ..scraper import _BasicScraper from ..helpers import indirectStarter from ..util import tagre class TheBrads(_BasicScraper): description = u'ArchiveFirst World Problems Comic - By Brad Colbow' url = 'http://bradcolbow.com/archive/C4/' stripUrl = url + '%s/' firstStripUrl = stripUrl % 'P125' imageSearch = compile(tagre("img", "src", r'(http://s3\.amazonaws\.com/the_brads/the-?brads[-_][^"]+)')) prevSearch = compile(tagre("a", "href", r'(http://bradcolbow\.com/archive/C4/[^"]+)', before="prev")) multipleImagesPerStrip = True help = 'Index format: a letter and a number' class TheDevilsPanties(_BasicScraper): description = u"It's not Satanic Porn" url = 'http://thedevilspanties.com/' stripUrl = url + 'archives/%s' firstStripUrl = stripUrl % '300' imageSearch = compile(tagre("img", "src", r'(http://cdn\.thedevilspanties\.com/comics/[^"]+)')) prevSearch = compile(tagre("a", "href", r'(/archives/\d+)', after="Previous")) help = 'Index format: number' class TheDreamlandChronicles(_BasicScraper): description = u'The Dreamland Chronicles' url = 'http://www.thedreamlandchronicles.com/' stripUrl = url + 'comic/%s/' firstStripUrl = stripUrl % 'page-1' rurl = escape(url) imageSearch = compile(tagre("img", "src", r'(http://www\.thedreamlandchronicles\.com/wp-content/uploads/\d+/\d+/\d+-\d+-\d+[^"]*)')) prevSearch = compile(tagre("a", "href", r'(%s[^"]*)' % rurl, after='navi-prev"')) help = 'Index format: page-n or chapter-n' @classmethod def namer(cls, imageUrl, pageUrl): """Remove trailing digit from day number.""" name = imageUrl.split('/')[-1] base, ext = name.split('.', 1) bp = base.split('-') if len(bp[2]) == 3: bp[2] = bp[2][:-1] return "%s-%s-%s.%s" % (bp[0], bp[1], bp[2], ext) class TheGamerCat(_BasicScraper): description = u"The Gamer Cat" url = 'http://www.thegamercat.com/' rurl = escape(url) stripUrl = url + '%s/' firstStripUrl = stripUrl % '2011/06/06102011' imageSearch = compile(tagre("img", "src", r'(%swordpress/comics/[^"/]+)' % rurl)) prevSearch = compile(tagre("a", "href", r'(%s\d+/\d+/[^"/]+/)' % rurl , after="navi navi-prev")) help = 'Index format: yyyy/mm/mmddyyyy' class TheGentlemansArmchair(_BasicScraper): url = 'http://thegentlemansarmchair.com/' rurl = escape(url) stripUrl = url + 'comic/%s' firstStripUrl = stripUrl % 'dora-the-explorer/' imageSearch = compile(tagre("div", "id", r'comic') + "\s*.*\s*" + tagre("img", "src", r'(%swp-content/uploads/\d+/\d+/[^"]+)' % rurl)) prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after='navi-prev')) textSearch = compile(r'