summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-24 02:15:18 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-01-24 02:15:18 +0100
commit312bbd1e82404a8e73bb14fae2acb81f7ea62193 (patch)
treed41b5b9b157fec34af45df5f0111bae1aa0e9e99 /module/plugins
parent[ExtractArchive] Fix encrypted flag init (diff)
downloadpyload-312bbd1e82404a8e73bb14fae2acb81f7ea62193.tar.xz
[SimpleHoster] Fix https://github.com/pyload/pyload/issues/1070
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/internal/SimpleHoster.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 13a26c732..3770d0575 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -140,15 +140,14 @@ def timestamp():
#@TODO: Move to hoster class in 0.4.10
-def fileUrl(self, url, follow_location=False):
+def fileUrl(self, url, follow_location=None):
link = ""
redirect = 1
- if isinstance(follow_location, bool):
- redirect = 5
-
- elif isinstance(follow_location, int):
+ if type(follow_location) is int:
redirect = max(follow_location, 1)
+ else:
+ redirect = 5
for i in xrange(redirect):
try:
@@ -204,7 +203,7 @@ def fileUrl(self, url, follow_location=False):
mimetype = header['content-type'].split(';')[0].strip()
elif extension:
- mimetype = mimetypes.guess_extension(extension, False)[0] or "application/octet-stream"
+ mimetype = mimetypes.guess_type(extension, False)[0] or "application/octet-stream"
else:
mimetype = ""
@@ -246,7 +245,7 @@ def secondsToMidnight(gmt=0):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "1.07"
+ __version__ = "1.08"
__pattern__ = r'^unmatchable$'