From 10eb1ff5ec2c068c7be174fd59601380f70d9be9 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Wed, 6 Mar 2013 20:21:20 +0100 Subject: [PATCH] Fix dilbert filenames. --- dosagelib/plugins/d.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dosagelib/plugins/d.py b/dosagelib/plugins/d.py index 6f41204a7..bf75b8c4f 100644 --- a/dosagelib/plugins/d.py +++ b/dosagelib/plugins/d.py @@ -99,7 +99,12 @@ class Dilbert(_BasicScraper): prevSearch = compile(tagre("a", "href", r'(/\d+-\d+-\d+/)', after="STR_Prev")) imageSearch = compile(tagre("img", "src", r'(/dyn/str_strip/[^"]+\.strip\.zoom\.gif)')) help = 'Index format: yyyy-mm-dd' - # XXX namer + + @classmethod + def namer(cls, imageUrl, pageUrl): + ext = imageUrl.rsplit(".", 1)[1] + name = pageUrl.rsplit("/", 2)[1] + return "%s.%s" % (name, ext) class DMFA(_BasicScraper):