summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-10 03:35:47 +0100
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-10 03:35:47 +0100
commit3e81879d0c472c1079e75a12c7a8584f8304a8db (patch)
tree5974c25f4ddcf4b454a37445db225bd1bfd0193d
parent[UptoboxCom] TEMP_OFFLINE_PATTERN (diff)
downloadpyload-3e81879d0c472c1079e75a12c7a8584f8304a8db.tar.xz
[SimpleHoster] Fixup
-rw-r--r--module/plugins/internal/SimpleHoster.py14
-rw-r--r--module/plugins/internal/XFSHoster.py4
2 files changed, 11 insertions, 7 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 2754b0b18..4777d0641 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -246,7 +246,7 @@ def secondsToMidnight(gmt=0):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "1.17"
+ __version__ = "1.18"
__pattern__ = r'^unmatchable$'
@@ -537,11 +537,10 @@ class SimpleHoster(Hoster):
elif hasattr(self, 'ERROR_PATTERN'):
m = re.search(self.ERROR_PATTERN, self.html)
if m:
- errmsg
try:
- errmsg = m.group(1)
+ errmsg = m.group(1).strip()
except Exception:
- errmsg = m.group(0)
+ errmsg = m.group(0).strip()
self.info['error'] = errmsg
@@ -557,8 +556,13 @@ class SimpleHoster(Hoster):
elif hasattr(self, 'WAIT_PATTERN'):
m = re.search(self.WAIT_PATTERN, self.html)
if m:
+ try:
+ waitmsg = m.group(1).strip()
+ except Exception:
+ waitmsg = m.group(0).strip()
+
wait_time = sum(int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in
- re.findall(r'(\d+)\s*(hr|hour|min|sec)', m.group(0), re.I))
+ re.findall(r'(\d+)\s*(hr|hour|min|sec)', waitmsg, re.I))
self.wait(wait_time, wait_time > 300)
self.info.pop('error', None)
diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py
index e0c6d8824..6e0b5e4ab 100644
--- a/module/plugins/internal/XFSHoster.py
+++ b/module/plugins/internal/XFSHoster.py
@@ -16,7 +16,7 @@ from module.utils import html_unescape
class XFSHoster(SimpleHoster):
__name__ = "XFSHoster"
__type__ = "hoster"
- __version__ = "0.44"
+ __version__ = "0.45"
__pattern__ = r'^unmatchable$'
@@ -195,7 +195,7 @@ class XFSHoster(SimpleHoster):
if 'wait' in self.errmsg:
wait_time = sum(int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in
re.findall(r'(\d+)\s*(hr|hour|min|sec)', self.errmsg, re.I))
- self.wait(wait_time, True)
+ self.wait(wait_time, wait_time > 300)
elif 'country' in self.errmsg:
self.fail(_("Downloads are disabled for your country"))