Fix Nightshift

This commit is contained in:
Techwolf 2023-06-07 00:02:40 -07:00 committed by Tobias Gruetzmacher
parent cf95aa076a
commit ed1124662c
No known key found for this signature in database

View file

@ -113,29 +113,18 @@ class Nicky510(WordPressNavi):
endOfLife = True endOfLife = True
class Nightshift(WordPressWebcomic): class Nightshift(ParserScraper):
url = 'https://poecatcomix.com/nightshift-static/' url = 'https://poecatcomix.com/nightshiftcomic/'
stripUrl = 'https://poecatcomix.com/nightshift/%s/' stripUrl = url + '%s/'
firstStripUrl = stripUrl % 'ns-cover' firstStripUrl = stripUrl % 'ns-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")]'
latestSearch = '//div[@class="post-title"]//a'
starter = indirectStarter
adult = True adult = True
def starter(self):
# Build list of chapters for naming
indexPage = self.getPage(self.url)
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('blood-brothers', 'bloodbrothers').replace('bb-2', 'bb2').replace('ns7-', 'page-')
filename = 'ns%d-%s.%s' % (self.currentChapter, page, imageUrl.rsplit('.', 1)[-1])
if pageUrl in self.chapters:
self.currentChapter = self.currentChapter - 1
return filename
class Nimona(_ParserScraper): class Nimona(_ParserScraper):