Fix for Ruthe.de and NichtLustig.de (now joscha.com) (#181)

NichtLustig moved to joscha.com, new layout and image-names.

Co-authored-by: Marius Knabben <marius.knabben@rwth-aachen.de>
This commit is contained in:
Arwarld 2020-12-02 22:37:18 +01:00 committed by GitHub
parent 0ea45ce986
commit 651bd62267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 9 deletions

View file

@ -6,7 +6,7 @@
from re import compile, escape
from ..scraper import _BasicScraper, _ParserScraper
from ..helpers import indirectStarter
from ..helpers import indirectStarter, bounceStarter
from ..util import tagre
from .common import _ComicControlScraper, _WordPressScraper, _WPNavi, _WPWebcomic
@ -92,14 +92,19 @@ class NeverSatisfied(_ComicControlScraper):
class NichtLustig(_BasicScraper):
url = 'http://www.nichtlustig.de/main.html'
stripUrl = 'http://static.nichtlustig.de/toondb/%s.html'
url = 'https://joscha.com/'
starter = bounceStarter
stripUrl = url + 'nichtlustig/%s/'
firstStripUrl = stripUrl % '000501'
lang = 'de'
imageSearch = compile(r'background-image:url\((http://static\.nichtlustig\.de/comics/full/\d+\.jpg)')
prevSearch = compile(tagre("a", "href", r'(http://static\.nichtlustig\.de/toondb/\d+\.html)'))
latestSearch = compile(tagre("a", "href", r'([^"]*toondb/\d+\.html)'))
imageSearch = compile(tagre("img", "src", r'(https://joscha.com/data/media/cartoons/[0-9a-f-_]+.png)'))
prevSearch = compile(tagre("a", "href", r'(https://joscha.com/nichtlustig/\d+/)', after="next"))
nextSearch = compile(tagre("a", "href", r'(https://joscha.com/nichtlustig/\d+/)', after="prev"))
help = 'Index format: yymmdd'
starter = indirectStarter
def namer(self, image_url, page_url):
unused, filename, unused2 = page_url.rsplit('/', 2)
return '%s' % (filename)
class Nicky510(_WPNavi):

View file

@ -151,8 +151,7 @@ class Ruthe(_BasicScraper):
firstStripUrl = stripUrl % '1'
lang = 'de'
imageSearch = compile(tagre("img", "src", r'(/?cartoons/strip_\d+[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(/cartoon/\d+/datum/asc/)') +
'vorheriger')
prevSearch = compile(tagre("a", "href", r'(/cartoon/\d+/datum/asc/)'))
help = 'Index format: number'