From ed1124662c07efe3a19fcd65b4c1fbaf6fa2f62f Mon Sep 17 00:00:00 2001 From: Techwolf Date: Wed, 7 Jun 2023 00:02:40 -0700 Subject: [PATCH] Fix Nightshift --- dosagelib/plugins/n.py | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/dosagelib/plugins/n.py b/dosagelib/plugins/n.py index a4278fddf..21a66d588 100644 --- a/dosagelib/plugins/n.py +++ b/dosagelib/plugins/n.py @@ -113,29 +113,18 @@ class Nicky510(WordPressNavi): endOfLife = True -class Nightshift(WordPressWebcomic): - url = 'https://poecatcomix.com/nightshift-static/' - stripUrl = 'https://poecatcomix.com/nightshift/%s/' - firstStripUrl = stripUrl % 'ns-cover' - imageSearch = '//div[contains(@class, "webcomic-media")]//img' +class Nightshift(ParserScraper): + url = 'https://poecatcomix.com/nightshiftcomic/' + stripUrl = url + '%s/' + firstStripUrl = stripUrl % 'ns-issue-1-cover' + 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 - 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): - page = pageUrl.rstrip('/').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 + return pageUrl.rsplit('/', 2)[1] + '.' + imageUrl.rsplit('.', 1)[-1] class Nimona(_ParserScraper):