From 651bd62267c99a0362f8b465c691427e257e70b2 Mon Sep 17 00:00:00 2001 From: Arwarld Date: Wed, 2 Dec 2020 22:37:18 +0100 Subject: [PATCH] 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 --- dosagelib/plugins/n.py | 19 ++++++++++++------- dosagelib/plugins/r.py | 3 +-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/dosagelib/plugins/n.py b/dosagelib/plugins/n.py index 879aea409..fdfe7d020 100644 --- a/dosagelib/plugins/n.py +++ b/dosagelib/plugins/n.py @@ -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): diff --git a/dosagelib/plugins/r.py b/dosagelib/plugins/r.py index a883352d5..d33d43468 100644 --- a/dosagelib/plugins/r.py +++ b/dosagelib/plugins/r.py @@ -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'