# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2013 Bastian Kleineidam
from re import compile
from ..scraper import _BasicScraper
from ..helpers import bounceStarter
from ..util import tagre
class CaptainSNES(_BasicScraper):
url = 'http://www.captainsnes.com/'
stripUrl = url + '%s/'
imageSearch = compile(r"')
multipleImagesPerStrip = True
help = 'Index format: yyyy/mm/dd/nnn-stripname'
class CaseyAndAndy(_BasicScraper):
url = 'http://www.galactanet.com/comic/'
stripUrl = url + 'view.php?strip=%s'
imageSearch = compile(tagre("img", "src", r'(Strip\d+\.gif)'))
prevSearch = compile(tagre("a", "href", r'(view\.php\?strip=\d+)')
+ tagre("img", "src", r'previous\.gif'))
help = 'Index format: number'
class CaribbeanBlue(_BasicScraper):
url = 'http://cblue.katbox.net/'
stripUrl = url + 'archive/%s'
imageSearch = compile(tagre("img", "src", r'(http://cblue\.katbox\.net/wp-content/webcomic/cblue/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://cblue\.katbox\.net/archive/[^"]+)', after="previous"))
help = 'Index format: nnn-stripname'
class Catalyst(_BasicScraper):
baseUrl = "http://catalyst.spiderforest.com/"
url = baseUrl + "comic.php?comic_id=415"
stripUrl = baseUrl + "comic.php?comic_id=%s"
imageSearch = compile(tagre("img", "src", r'(http://catalyst\.spiderforest\.com/comics/[^"]+)'))
prevSearch = compile("" + tagre("a", "href", r'(http://catalyst\.spiderforest\.com/comic\.php\?comic_id=\d+)'))
help = 'Index format: number'
class Catena(_BasicScraper):
url = 'http://catenamanor.com/'
stripUrl = url + '%s'
imageSearch = compile(tagre("img", "src", r'(http://catenamanor\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)', after='rel="prev"'))
help = 'Index format: yyyy/mm/dd/'
class ChasingTheSunset(_BasicScraper):
url = 'http://www.fantasycomic.com/'
stripUrl = url + 'index.php?p=c%s'
imageSearch = compile(r'(/cmsimg/.+?)".+?comic-img')
prevSearch = compile(r']+/images/(?:nav_02|previous_day)\.gif")
help='Index format: yyyymmdd'
class Chisuji(_BasicScraper):
url = 'http://www.chisuji.com/'
stripUrl = url + '%s'
imageSearch = compile(r'')
help = 'Index format: yyyy/mm/dd/strip-name'
class ChugworthAcademy(_BasicScraper):
url = 'http://chugworth.com/'
stripUrl = url + '?p=%s'
imageSearch = compile(r']+?title="Previous">')
help = 'Index format: n (unpadded)'
class ChugworthAcademyArchive(_BasicScraper):
url = 'http://chugworth.com/archive/?strip_id=422'
stripUrl = 'http://chugworth.com/archive/?strip_id=%s'
imageSearch = compile(r'&laq')
help = 'Index format: non'
class Comedity(_BasicScraper):
url = 'http://www.comedity.com/'
stripUrl = url + 'index.php?strip_id=%s'
imageSearch = compile(r' *")
help = 'Index format: n (unpadded)'
class CyanideAndHappiness(_BasicScraper):
url = 'http://www.explosm.net/comics/'
starter = bounceStarter(url, compile(tagre("a", "href", r"(/comics/\d+/)", before="next")))
stripUrl = url + '%s/'
imageSearch = compile(tagre("img", "src", r'(http://(?:www\.)?explosm\.net/db/files/[^"]+)', before="a daily webcomic"))
prevSearch = compile(tagre("a", "href", r'(/comics/\d+/)', before="prev"))
help = 'Index format: n (unpadded)'
@classmethod
def namer(cls, imageUrl, pageUrl):
imgname = imageUrl.split('/')[-1]
imgnum = pageUrl.split('/')[-2]
return '%s_%s' % (imgnum, imgname)
class CrimsonDark(_BasicScraper):
url = 'http://www.davidcsimon.com/crimsondark/'
stripUrl = url + 'index.php?view=comic&strip_id=%s'
imageSearch = compile(r'src="(.+?strips/.+?)"')
prevSearch = compile(r'')
help = 'Index format: nnn'
class CowboyJedi(_BasicScraper):
url = 'http://www.cowboyjedi.com/'
stripUrl = url + '%s'
imageSearch = compile(tagre("img", "src", r'(http://www\.cowboyjedi.\com/comics/[^"]+)'))
prevSearch = compile(r'')
help = 'Index format: nnn'
class Champ2010(_BasicScraper):
# the latest URL is hard coded since the comic is discontinued
url = 'http://jedcollins.com/champ2010/champ-12-30-10.html'
stripUrl = 'http://jedcollins.com/champ2010/%s.html'
imageSearch = compile(tagre("img", "src", r'(http://jedcollins\.com/champ2010/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://jedcollins\.com/champ2010/[^"]+)', after="Previous"))
help = 'Index format: yy-dd-mm'
class Chucklebrain(_BasicScraper):
url = 'http://www.chucklebrain.com/main.php'
stripUrl = url + '?img=%s'
imageSearch = compile(tagre("img", "src", r'(/images/strip[^"]+)'))
prevSearch = compile(r'')
help = 'Index format: nnn'