From 74cca6bac34e72c3e3d03bf2e83bc60f211e20a7 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 7 Nov 2013 20:47:31 +0100 Subject: [PATCH] Fixed oglaf comic skipping. --- doc/changelog.txt | 6 +++++- dosagelib/plugins/o.py | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index 0ae4c79f0..a28243739 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -3,7 +3,11 @@ Dosage 2.6 (released xx.xx.2013) Features: - comics: Added DarthsAndDroid - docs: Document how to add new comics in docs/adding_new_comics.txt - Closes: GH bug 39 + Closes: GH bug #39 + +Fixes: +- comics: Fixed Oglaf + Closes: GH bug #41 Dosage 2.5 (released 18.7.2013) diff --git a/dosagelib/plugins/o.py b/dosagelib/plugins/o.py index 0c0ec7671..9cf3cf74a 100644 --- a/dosagelib/plugins/o.py +++ b/dosagelib/plugins/o.py @@ -35,8 +35,13 @@ class Oglaf(_BasicScraper): url = 'http://oglaf.com/' stripUrl = url + '%s/' imageSearch = compile(tagre("img", "src", r'(http://media\.oglaf\.com/comic/[^"]+)', before="strip")) - prevSearch = compile(tagre("a", "href", r'(/[^"]+)') + tagre("div", "id", "pvs?")) - help = 'Index format: stripname/nn' + prevSearch = ( + # first search for "next page" URLs + compile(tagre("a", "href", r'(/[^"]+/\d+/)') + tagre("div", "id", "nx")), + # then for "prev story" + compile(tagre("a", "href", r'(/[^"]+)') + tagre("div", "id", "pvs?")), + ) + help = 'Index format: stripname' adult = True @classmethod