Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoorlyDrawnLines: Fix after site redesign #329

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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