Fix StarfireAgency

This commit is contained in:
Techwolf 2023-06-07 00:05:14 -07:00 committed by Tobias Gruetzmacher
parent ed1124662c
commit 540163b9ee
No known key found for this signature in database

View file

@ -527,30 +527,18 @@ class StarCrossdDestiny(_ParserScraper):
return directory + '-' + filename return directory + '-' + filename
class StarfireAgency(WordPressWebcomic): class StarfireAgency(ParserScraper):
url = 'https://poecatcomix.com/starfire-agency-static/' url = 'https://poecatcomix.com/starfirecomic/'
stripUrl = 'https://poecatcomix.com/starfire-agency/%s/' stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2005-09-201' firstStripUrl = stripUrl % 'sfa-issue-1-cover'
imageSearch = '//div[contains(@class, "webcomic-media")]//img' imageSearch = '//img[@class="scale-with-grid wp-post-image"]'
prevSearch = '//a[d:class("fixed-nav-prev")]'
def starter(self): latestSearch = '//div[@class="post-title"]//a'
# Build list of chapters for naming starter = indirectStarter
indexPage = self.getPage(self.url) adult = True
self.chapters = indexPage.xpath('//a[./img[contains(@class, "attachment-large")]]/@href')
latestPage = self.chapters[0]
self.chapters = self.chapters[1:]
self.currentChapter = len(self.chapters)
return latestPage
def namer(self, imageUrl, pageUrl): def namer(self, imageUrl, pageUrl):
page = pageUrl.rstrip('/').rsplit('/', 1)[-1] return pageUrl.rsplit('/', 2)[1] + '.' + imageUrl.rsplit('.', 1)[-1]
page = page.replace('3page00', 'cover3').replace('6429', 'cover7').replace('sfa-6-5-cover', 'cover6')
page = page.replace('sfa01', 'page01').replace('sfa03', 'page03').replace('sfa04', 'page04')
page = page.replace('sfa24', 'page24').replace('sfa07', 'page')
filename = 'sfa%d-%s.%s' % (self.currentChapter, page, imageUrl.rsplit('.', 1)[-1])
if pageUrl in self.chapters:
self.currentChapter = self.currentChapter - 1
return filename
class StarTrip(ComicControlScraper): class StarTrip(ComicControlScraper):