From c583e8717e7ee08b9062077d82bb2faf4dad1edc Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Wed, 4 Dec 2013 17:56:54 +0100 Subject: [PATCH] Store large xkcd images. --- doc/changelog.txt | 2 ++ dosagelib/plugins/x.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/doc/changelog.txt b/doc/changelog.txt index 02ffdeab3..37652741c 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -7,6 +7,8 @@ Features: Fixes: - comics: Fixed ForLackOfABetterComic. +- comics: Store large xkcd images if available. + Closes: GH bug #43 Dosage 2.7 (released 24.11.2013) diff --git a/dosagelib/plugins/x.py b/dosagelib/plugins/x.py index a8be410b6..fae1f2f51 100644 --- a/dosagelib/plugins/x.py +++ b/dosagelib/plugins/x.py @@ -26,3 +26,9 @@ class xkcd(_BasicScraper): index = int(pageUrl.rstrip('/').rsplit('/', 1)[-1]) name = imageUrl.rsplit('/', 1)[-1].split('.')[0] return '%03d-%s' % (index, name) + + @classmethod + def imageUrlModifier(cls, url, data): + if url and '/large/' in data: + return url.replace(".png", "_large.png") + return url