# SPDX-License-Identifier: MIT # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam # Copyright (C) 2015-2020 Tobias Gruetzmacher # Copyright (C) 2019-2020 Daniel Ring from re import compile, escape from ..util import tagre from ..scraper import _BasicScraper, _ParserScraper from ..helpers import indirectStarter, joinPathPartsNamer from .common import _ComicControlScraper, _WPNaviIn, _WordPressScraper 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"> 1252 else 'fv' return self.stripUrl % (chapter, color, index) class FreighterTails(_ParserScraper): url = 'http://www.mzzkiti.com/' stripUrl = url + 'log%s.htm' firstStripUrl = stripUrl % '001' imageSearch = ('//img[contains(@src, "Strip")]', '//img[contains(@src, "Caption")]') prevSearch = '//a[./img[contains(@src, "prev")]]' endOfLife = True class FriendsYouAreStuckWith(_WordPressScraper): url = 'http://friendsyasw.com/' stripUrl = url + 'comic/%s/' firstStripUrl = stripUrl % 'wanted' def namer(self, imageUrl, pageUrl): page = self.getPage(pageUrl) strip = page.xpath('//div[@id="comic-wrap"]/@class')[0].replace('comic-id-', '') return strip + '_' + imageUrl.rstrip('/').rsplit('/', 1)[-1] 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(_WordPressScraper): url = ('https://web.archive.org/web/20170205105241/' 'http://funinjammies.com/') stripUrl = url + 'comic.php?issue=%s' firstStripUrl = stripUrl % '1' prevSearch = '//a[text()="< Prev"]' endOfLife = True help = 'Index format: n (unpadded)' class FurPiled(_ParserScraper): stripUrl = ('https://web.archive.org/web/20160404074145/' 'http://www.liondogworks.com/images/fp-%03d.jpg') url = stripUrl % 427 firstStripUrl = stripUrl % 1 endOfLife = True def getPrevUrl(self, url, data): # Skip missing pages nextStrip = int(url.rsplit('/', 1)[-1].split('.', 1)[0].replace('fp-', '')) - 1 if nextStrip in [407, 258, 131, 110, 97, 31]: nextStrip = nextStrip - 1 return self.stripUrl % nextStrip def fetchUrls(self, url, data, urlSearch): # URLs are direct links to images return [url] class FurthiaHigh(_ParserScraper): url = 'http://furthiahigh.concessioncomic.com/' stripUrl = url + 'index.php?pid=%s' firstStripUrl = stripUrl % '20080128' imageSearch = '//img[contains(@alt, "Comic")]' prevSearch = '//a[./img[@alt="Previous"]]' multipleImagesPerStrip = True