# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2013 Bastian Kleineidam from re import compile, escape, IGNORECASE, MULTILINE from ..util import tagre from ..scraper import _BasicScraper from ..helpers import indirectStarter class FalconTwin(_BasicScraper): url = 'http://www.falcontwin.com/' stripUrl = url + 'index.html?strip=%s' firstStripUrl = stripUrl % '0' imageSearch = compile(r'"(strips/.+?)"') prevSearch = compile(r'"prev">Back', IGNORECASE) help = 'Index format: nn-m (comicNumber-partNumber)' starter = indirectStarter(url, compile(r'\(NEW \d{2}/\d{2}/\d{2}\)\s*\n*\s*\d+', MULTILINE)) @classmethod def namer(cls, imageUrl, pageUrl): num = pageUrl.split('/')[-1].split('-')[0] part = pageUrl.split('-')[-1].split('.')[0] return '%s-%s' % (part, num) def getIndexStripUrl(self, index): index, part = index.split('-') return self.stripUrl % (part, index, part) class FantasyRealms(_BasicScraper): url = 'http://www.fantasyrealmsonline.com/' stripUrl = url + 'manga/%s.php' imageSearch = compile(r'Previous Strip') help = 'Index format: nnn' class FeyWinds(_BasicScraper): baseurl = 'http://kitsune.rydia.net/' url = baseurl + 'index.html' stripUrl = baseurl + 'comic/page.php?id=%s' imageSearch = compile(r"(../comic/pages//.+?)'") prevSearch = compile(r"(page.php\?id=.+?)'.+?navprevious.png") help = 'Index format: n (unpadded)' starter = indirectStarter(url, compile(r'(comic/page.php\?id.+?)"')) class FilibusterCartoons(_BasicScraper): url = 'http://www.filibustercartoons.com/' rurl = escape(url) stripUrl = url + 'index.php/%s' firstStripUrl = stripUrl % '2001/06/28/poor-jean' imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl)) prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after="prev")) help = 'Index format: yyyy/mm/dd/name' class FirstWorldProblems(_BasicScraper): url = 'http://bradcolbow.com/archive/C5/' stripUrl = url + '%s/' firstStripUrl = stripUrl % 'P10' imageSearch = compile(tagre("img", "src", r'(http://(?:fwpcomics\.s3\.amazonaws\.com|s3\.amazonaws\.com/fwpcomics)/s1-[^"]+)')) prevSearch = compile(tagre("a", "href", r'(http://bradcolbow\.com/archive/C5/[^"]+)', before="prev")) multipleImagesPerStrip = True help = 'Index format: a letter and a number' class FlakyPastry(_BasicScraper): baseurl = 'http://flakypastry.runningwithpencils.com/' url = baseurl + 'index.php' stripUrl = baseurl + 'comic.php?strip_id=%s' firstStripUrl = stripUrl % '0' imageSearch = compile(r']).+?(/footloose/.+?)".+?(?:prev)') help = 'Index format: n (unpadded)' class ForLackOfABetterComic(_BasicScraper): url = 'http://forlackofabettercomic.com/' rurl = escape(url) stripUrl = url + '?id=%s' firstStripUrl = stripUrl % '1' imageSearch = compile(tagre("img", "src", r'(%simg/comic/\d+[^"]+)' % rurl, after="comicimg")) prevSearch = compile(tagre("a", "href", r'(%s\?id\=\d+)' % rurl) + r'Prev') help = 'Index format: number' description = 'A hand drawn comic about everyday life situations.' class Freefall(_BasicScraper): url = 'http://freefall.purrsia.com/default.htm' stripUrl = 'http://freefall.purrsia.com/ff%s/fc%s.htm' imageSearch = compile(r'Previous') help = 'Index format: nnnn/nnnnn' class FredoAndPidjin(_BasicScraper): url = 'http://www.pidjin.net/' stripUrl = url + '%s/' firstStripUrl = stripUrl % '2006/02/19/goofy-monday' help = 'Index format: yyyy/mm/dd/name' imageSearch = compile(tagre('img', 'src', '(http://cdn\.pidjin\.net/wp-content/uploads/\d+/\d+/[^"]+\.[a-z]+)')) multipleImagesPerStrip = True prevSearch = compile(tagre('a', 'href', '([^"]+)')+"Prev") starter = indirectStarter(url, compile(tagre('a', 'href', "("+url+r'\d\d\d\d/\d\d/\d\d/[^"]+/)'))) class FullFrontalNerdity(_BasicScraper): url = 'http://ffn.nodwick.com/' rurl = escape(url) stripUrl = url + '?p=%s' firstStripUrl = stripUrl % '6' imageSearch = compile(tagre("img", "src", r'(%sffnstrips/\d+-\d+-\d+\.[^"]+)' % rurl)) prevSearch = compile(tagre("a", "href", r'(%s\?p=\d+)' % rurl, after="prev")) help = 'Index format: number' class FunInJammies(_BasicScraper): url = 'http://www.funinjammies.com/' stripUrl = url + 'comic.php?issue=%s' firstStripUrl = stripUrl % '1' imageSearch = compile(r'(/comics/.+?)"') prevSearch = compile(r'(/comic.php.+?)" id.+?prev') help = 'Index format: n (unpadded)'