Skip to content

Commit

Permalink
PoorlyDrawnLines: Fix after site redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
vemek committed Jul 1, 2024
1 parent df1e72e commit 5c27aab
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions dosagelib/plugins/p.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,36 @@ def getPrevUrl(self, url, data):
prefix = url.rsplit('/', 1)[0]
return "%s/index%d.html" % (prefix, num)


class PoorlyDrawnLines(_ParserScraper):
url = 'http://poorlydrawnlines.com/comic/'
firstStripUrl = url + 'campus-characters/'
imageSearch = '//div[d:class("comic")]//img'
url = 'https://poorlydrawnlines.com/comic/'
stripUrl = url + '%s/'
multipleImagesPerStrip = True
firstStripUrl = stripUrl % 'hardly-essayists'
imageSearch = '//div[d:class("entry-content")]//img[@data-src]/@data-src'
prevSearch = '//a[@rel="prev"]'

def shouldSkipUrl(self, url, _data):
"""Skip pages without a comic."""
skipUrls = [self.stripUrl % s for s in (
'hope-it-all-works-out-new-book-coming-this-fall',
'poorly-drawn-lines-animated-series',
'poorly-drawn-lines-episode-two',
'watch-poorly-drawn-lines-on-hulu',
)]
return url in skipUrls

Check warning on line 247 in dosagelib/plugins/p.py

View check run for this annotation

Codecov / codecov/patch

dosagelib/plugins/p.py#L247

Added line #L247 was not covered by tests

def getPrevUrl(self, url: str, data):
"""Skip missing comics which redirect back to home page"""
if url == self.stripUrl % '8198':
return self.stripUrl % 'excited-2'

Check warning on line 252 in dosagelib/plugins/p.py

View check run for this annotation

Codecov / codecov/patch

dosagelib/plugins/p.py#L252

Added line #L252 was not covered by tests
elif url == self.stripUrl % '8186':
return self.stripUrl % 'to-hell-2'

Check warning on line 254 in dosagelib/plugins/p.py

View check run for this annotation

Codecov / codecov/patch

dosagelib/plugins/p.py#L254

Added line #L254 was not covered by tests
elif url == self.stripUrl % '8177':
return self.stripUrl % 'feel-real'

Check warning on line 256 in dosagelib/plugins/p.py

View check run for this annotation

Codecov / codecov/patch

dosagelib/plugins/p.py#L256

Added line #L256 was not covered by tests
elif url == self.stripUrl % '2056':
return self.stripUrl % 'stereotype'

Check warning on line 258 in dosagelib/plugins/p.py

View check run for this annotation

Codecov / codecov/patch

dosagelib/plugins/p.py#L258

Added line #L258 was not covered by tests

return super().getPrevUrl(url, data)

Check warning on line 260 in dosagelib/plugins/p.py

View check run for this annotation

Codecov / codecov/patch

dosagelib/plugins/p.py#L260

Added line #L260 was not covered by tests

class PoppyOPossum(WordPressScraper):
baseUrl = 'https://www.poppy-opossum.com/'
Expand Down

0 comments on commit 5c27aab

Please sign in to comment.