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

View file

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