From 6df6549c97449c9860723a43eccc2df6ce5307ee Mon Sep 17 00:00:00 2001 From: Techwolf Date: Thu, 11 Jul 2019 23:37:44 -0700 Subject: [PATCH] Split Catena into CatenaCafe & CatenaManor --- dosagelib/plugins/c.py | 36 ++++++++++++++++++++++++++++++++++-- dosagelib/plugins/old.py | 1 + 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/dosagelib/plugins/c.py b/dosagelib/plugins/c.py index 52ca5123d..5d20a0e7e 100644 --- a/dosagelib/plugins/c.py +++ b/dosagelib/plugins/c.py @@ -92,8 +92,40 @@ class CatAndGirl(_ParserScraper): prevSearch = '//a[@rel="prev"]' -class Catena(_WordPressScraper): - url = 'http://catenamanor.com/' +class CatenaCafe(_WordPressScraper): + name = 'CatenaManor/CatenaCafe' + url = 'https://catenamanor.com/' + stripUrl = url + 'comic/%s/' + firstStripUrl = stripUrl % 'reboot-book1cover-small' + + +class CatenaManor(_ParserScraper): + # Retrieve comic from the Internet Archive + baseUrl = 'https://web.archive.org/web/20141027141116/http://catenamanor.com/' + url = baseUrl + 'archives' + stripUrl = baseUrl + '%s/' + firstStripUrl = stripUrl % '2003/07' + imageSearch = '//img[@class="comicthumbnail"]' + multipleImagesPerStrip = True + endOfLife = True + strips = [] + + def starter(self): + # Retrieve archive links and select valid range + archivePage = self.getPage(self.url) + archiveStrips = archivePage.xpath('//div[@id="archivepage"]//a') + valid = False + for link in archiveStrips: + if self.stripUrl % '2012/01' in link.get('href'): + valid = True + elif self.stripUrl % '2003/06' in link.get('href'): + valid = False + if valid: + self.strips.append(link.get('href')) + return self.strips.pop(0) + + def getPrevUrl(self, url, data): + return self.strips.pop(0) class CatsAndCameras(_WordPressScraper): diff --git a/dosagelib/plugins/old.py b/dosagelib/plugins/old.py index d8287dab1..b29da5497 100644 --- a/dosagelib/plugins/old.py +++ b/dosagelib/plugins/old.py @@ -565,6 +565,7 @@ class Renamed(Scraper): return ( # Renamed in 2.16 cls('1997', '1977'), + cls('Catena', 'CatenaManor/CatenaCafe'), cls('ComicFury/Alya', 'ComicFury/AlyaTheLastChildOfLight'), cls('ComicFury/Boatcrash', 'ComicFury/BoatcrashChronicles'), cls('ComicFury/Crimsonpixel', 'ComicFury/CrimsonPixelComics'),