Fix Nightshift
This commit is contained in:
parent
d3f2a9e27a
commit
9b69eaf4ff
1 changed files with 21 additions and 13 deletions
|
@ -103,22 +103,30 @@ class Nicky510(_WPNavi):
|
||||||
|
|
||||||
|
|
||||||
class Nightshift(_ParserScraper):
|
class Nightshift(_ParserScraper):
|
||||||
url = 'http://poecatcomix.com/comic-titles/nightshift/'
|
url = 'https://poecatcomix.com/nightshift-static/'
|
||||||
stripUrl = url + '%s/'
|
stripUrl = 'https://poecatcomix.com/comic/%s/'
|
||||||
firstStripUrl = stripUrl % 'nightshift-volume1/ns-chapter-1'
|
firstStripUrl = stripUrl % 'ns1-page-cover'
|
||||||
imageSearch = '//div[@id="gallery-1"]//img'
|
imageSearch = '//div[@class="mangapress-media-img"]/img'
|
||||||
prevSearch = ('//a[./span[text()="PAST CHAPTER"]]',
|
prevSearch = '//li[@class="link-prev"]/a'
|
||||||
'//a[./span[text()="LAST CHAPTER"]]')
|
latestSearch = '//li[@class="link-last"]/a/@href'
|
||||||
latestSearch = '//a[./img[contains(@src, "Latest-Page")]]'
|
|
||||||
starter = indirectStarter
|
|
||||||
multipleImagesPerStrip = True
|
|
||||||
adult = True
|
adult = True
|
||||||
|
|
||||||
|
def starter(self):
|
||||||
|
# Build list of chapters for navigation
|
||||||
|
indexPage = self.getPage(self.url)
|
||||||
|
self.chapters = indexPage.xpath('//a[./img[contains(@class, "attachment-large")]]/@href')
|
||||||
|
chapterPage = self.getPage(self.chapters[-1])
|
||||||
|
return chapterPage.xpath(self.latestSearch)[0]
|
||||||
|
|
||||||
|
def getPrevUrl(self, url, data):
|
||||||
|
# Retrieve previous chapter from list
|
||||||
|
if url in self.chapters:
|
||||||
|
chapterPage = self.getPage(self.chapters[self.chapters.index(url) - 1])
|
||||||
|
return chapterPage.xpath(self.latestSearch)[0]
|
||||||
|
return super(Nightshift, self).getPrevUrl(url, data)
|
||||||
|
|
||||||
def namer(self, imageUrl, pageUrl):
|
def namer(self, imageUrl, pageUrl):
|
||||||
# Prepend chapter title to page filenames
|
return pageUrl.rstrip('/').rsplit('/', 1)[-1] + '.' + imageUrl.rsplit('.', 1)[-1]
|
||||||
chapter = pageUrl.rstrip('/').rsplit('/', 1)[-1].replace('ns-', 'ns1-')
|
|
||||||
page = imageUrl.rsplit('/', 1)[-1]
|
|
||||||
return chapter + '_' + page
|
|
||||||
|
|
||||||
|
|
||||||
class Nimona(_ParserScraper):
|
class Nimona(_ParserScraper):
|
||||||
|
|
Loading…
Reference in a new issue