From b090d86c9b80ad2916c7f03c8373fa45f3bb3000 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 27 Sep 2020 20:56:26 +0200 Subject: [PATCH] Switch Drowtales to parser scraper (also fixes it) --- dosagelib/plugins/d.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/dosagelib/plugins/d.py b/dosagelib/plugins/d.py index 7399c9d9b..d8d99989a 100644 --- a/dosagelib/plugins/d.py +++ b/dosagelib/plugins/d.py @@ -356,17 +356,12 @@ class DrMcNinja(_ParserScraper): help = 'Index format: {episode}p{page}' -class Drowtales(_BasicScraper): - baseUrl = 'http://www.drowtales.com/' - rurl = escape(baseUrl) - url = baseUrl + 'mainarchive.php' +class Drowtales(_ParserScraper): + url = 'http://www.drowtales.com/mainarchive.php' stripUrl = url + '?sid=%s' firstStripUrl = stripUrl % '4192' - imageSearch = ( - compile(tagre("img", "src", r'((%s)?mainarchive/[^"]+)' % rurl)), - compile(r'background-image:url\((mainarchive/[^\)]+center\.jpg)'), - ) - prevSearch = compile(tagre("a", "href", r'(\?sid=\d+)', before="link_prev_top")) + imageSearch = '//div[@id="content_middle"]//img' + prevSearch = '//a[@id="link_prev_top"]' help = 'Index format: number'