From 857d4cf2a26fe8683276180f18a82eaa1779163c Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Fri, 06 Jan 2012 19:17:59 +0000 Subject: Fix image downloading. If is downloading from upload.wikimedia.org don't add the page source url Signed-off-by: Gonzalo Odiard --- diff --git a/net.py b/net.py index 98589f1..e3a13cf 100644 --- a/net.py +++ b/net.py @@ -82,7 +82,9 @@ def image_handler(root, uid, document): image_title = path.rsplit("/", 1)[-1] # attempt to fix incomplete paths if (not path.startswith("http://")) and document.source != None and document.source.has_key("href"): - if path.startswith("/"): + if path.startswith("//upload"): + path = 'http:' + path + elif path.startswith("/"): path = document.source['href'].rsplit("/", 1)[0] + path else: path = document.source['href'].rsplit("/", 1)[0] + "/" + path -- cgit v0.9.1