From 89b38d450ff8dbb0f8dee5b5a1fd054fddf74f6f Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Thu, 15 Feb 2024 23:55:46 +0100 Subject: [PATCH] Fix PHDComics (fixes #238) --- dosagelib/plugins/p.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dosagelib/plugins/p.py b/dosagelib/plugins/p.py index 89f6f5f67..87a628f94 100644 --- a/dosagelib/plugins/p.py +++ b/dosagelib/plugins/p.py @@ -150,14 +150,16 @@ class PeterAndWhitney(_ParserScraper): prevSearch = '//a[./img[contains(@src, "nav_previous")]]' -class PHDComics(_ParserScraper): +class PHDComics(ParserScraper): BROKEN_COMMENT_END = compile(r'--!>') baseUrl = 'http://phdcomics.com/' url = baseUrl + 'comics.php' stripUrl = baseUrl + 'comics/archive.php?comicid=%s' firstStripUrl = stripUrl % '1' - imageSearch = '//img[@id="comic2"]' + imageSearch = ('//img[@id="comic2"]', + r'//img[d:class("img-responsive") and re:test(@name, "comic\d+")]') + multipleImagesPerStrip = True prevSearch = '//a[img[contains(@src, "prev_button")]]' nextSearch = '//a[img[contains(@src, "next_button")]]' help = 'Index format: n (unpadded)' @@ -173,7 +175,7 @@ class PHDComics(_ParserScraper): # video self.stripUrl % '1880', self.stripUrl % '1669', - ) + ) or data.xpath('//img[@id="comic" and contains(@src, "phd083123s")]') class Picklewhistle(ComicControlScraper):