Add Moonlace

This commit is contained in:
Techwolf 2019-06-29 14:39:13 -07:00 committed by Tobias Gruetzmacher
parent 280f4fdbb8
commit 085e1642fb

View file

@ -7,7 +7,7 @@ from __future__ import absolute_import, division, print_function
from re import compile, escape, IGNORECASE
from ..helpers import xpath_class
from ..helpers import indirectStarter, xpath_class
from ..scraper import _BasicScraper, _ParserScraper
from ..util import tagre
from .common import _ComicControlScraper, _WordPressScraper
@ -167,6 +167,30 @@ class MonsieurLeChien(_BasicScraper):
help = 'Index format: n'
class Moonlace(_ParserScraper):
stripUrl = 'http://dbcomics.darkblueworkshop.com/moonlace/%s/'
firstStripUrl = stripUrl % 'prologue/page-1'
url = firstStripUrl
imageSearch = '//div[@class="webcomic-image"]//img'
prevSearch = '//a[contains(@class, "previous-webcomic-link")]'
latestSearch = '//a[contains(@class, "last-webcomic-link")]'
adult = True
def starter(self):
# Set age-gate cookie
self.session.get(self.firstStripUrl + '?webcomic_birthday=1')
return indirectStarter(self)
def namer(self, imageUrl, pageUrl):
# Prepend chapter title to page filenames
chapter = pageUrl.rstrip('/').rsplit('/', 3)[-2]
chapter = chapter.replace('prologue', 'chapter-0-prologue')
chapter = chapter.replace('chapter-1', 'chapter-1-heritage')
chapter = chapter.replace('chapter2', 'chapter-2')
page = imageUrl.rsplit('/', 1)[-1]
return chapter + '_' + page
class Moonsticks(_ParserScraper):
url = "http://moonsticks.org/"
imageSearch = "//div[@class='entry']//img"