summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-18 12:06:22 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-18 12:06:22 +0200
commit66946591842ec27705bcc015e04016a7dabc388c (patch)
treeb68ab5f54e21e613dd36014e055f06b38b92e59b /module/plugins/internal
parent[SimpleHoster] Fix create_getInfo (diff)
downloadpyload-66946591842ec27705bcc015e04016a7dabc388c.tar.xz
[SimpleHoster] Fix https://github.com/pyload/pyload/issues/1404
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/SimpleHoster.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index aae3bac8c..4bf41a478 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -148,7 +148,7 @@ def getFileURL(self, url, follow_location=None):
self.logDebug("Redirect #%d to: %s" % (i, url))
header = self.load(url, just_header=True, decode=True)
- except Exception: #: Bad bad bad...
+ except Exception: #: Bad bad bad... rewrite this part in 0.4.10
req = pyreq.getHTTPRequest()
res = req.load(url, just_header=True, decode=True)
@@ -239,7 +239,7 @@ def secondsToMidnight(gmt=0):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "1.45"
+ __version__ = "1.46"
__pattern__ = r'^unmatchable$'
__config__ = [("use_premium", "bool", "Use premium account if available" , True),
@@ -334,7 +334,7 @@ class SimpleHoster(Hoster):
@classmethod
def getInfo(cls, url="", html=""):
info = cls.apiInfo(url)
- online = False if info['status'] != 2 else True
+ online = True if info['status'] is 2 else False
try:
info['pattern'] = re.match(cls.__pattern__, url).groupdict() #: pattern groups will be saved here
@@ -347,7 +347,7 @@ class SimpleHoster(Hoster):
info['error'] = "missing url"
info['status'] = 1
- elif info['status'] is 3 and not getFileURL(None, url):
+ elif info['status'] is 3:
try:
html = getURL(url, cookies=cls.COOKIES, decode=not cls.TEXT_ENCODING)
@@ -363,6 +363,9 @@ class SimpleHoster(Hoster):
elif e.code is 503:
info['status'] = 6
+ except Exception:
+ pass
+
if html:
if hasattr(cls, "OFFLINE_PATTERN") and re.search(cls.OFFLINE_PATTERN, html):
info['status'] = 1