From a51c92425e3b77b5a6b85babd29cc97411ee647c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 29 May 2015 01:53:28 +0200 Subject: [SimpleDereferer] Handle direct link --- module/plugins/internal/SimpleHoster.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/internal/SimpleHoster.py') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 0a9986d4c..d362a9615 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -175,7 +175,7 @@ def getFileURL(self, url, follow_location=None): if 'content-disposition' in header: link = url - elif 'location' in header and header['location'].strip(): + elif 'location' in header and header['location']: location = header['location'] if not urlparse.urlparse(location).scheme: @@ -193,7 +193,7 @@ def getFileURL(self, url, follow_location=None): else: extension = os.path.splitext(urlparse.urlparse(url).path.split('/')[-1])[-1] - if 'content-type' in header and header['content-type'].strip(): + if 'content-type' in header and header['content-type']: mimetype = header['content-type'].split(';')[0].strip() elif extension: @@ -509,7 +509,7 @@ class SimpleHoster(Hoster): self.correctCaptcha() - link = html_unescape(link.decode('unicode-escape')) #@TODO: Move this check to plugin `load` method in 0.4.10 + link = html_unescape(link.strip().decode('unicode-escape')) #@TODO: Move this check to plugin `load` method in 0.4.10 if not urlparse.urlparse(link).scheme: url_p = urlparse.urlparse(self.pyfile.url) -- cgit v1.2.3