From fbec95764feb18faad52347b2e0a5b9efa572e15 Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 2 Aug 2013 21:00:50 +0200 Subject: BasePlugin: fixed #208 (cherry picked from commit 8c5af8995b5d77f6d161d18f0812ee7aa2d141b5) Conflicts: pyload/plugins/hoster/BasePlugin.py --- pyload/plugins/hoster/BasePlugin.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pyload/plugins/hoster/BasePlugin.py') diff --git a/pyload/plugins/hoster/BasePlugin.py b/pyload/plugins/hoster/BasePlugin.py index 85d3c8ed6..b6d208f99 100644 --- a/pyload/plugins/hoster/BasePlugin.py +++ b/pyload/plugins/hoster/BasePlugin.py @@ -13,7 +13,7 @@ class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" __pattern__ = r"^unmatchable$" - __version__ = "0.18" + __version__ = "0.19" __description__ = """Base Plugin when any other didn't fit""" __author_name__ = ("RaNaN") __author_mail__ = ("RaNaN@pyload.org") @@ -82,7 +82,13 @@ class BasePlugin(Hoster): if 'location' in header: self.logDebug("Location: " + header['location']) - url = unquote(header['location']) + base = search(r'https?://[^/]+', url).group(0) + if header['location'].startswith("http"): + url = unquote(header['location']) + elif header['location'].startswith("/"): + url = base + unquote(header['location']) + else: + url = '%s/%s' % (base, unquote(header['location'])) else: break -- cgit v1.2.3