summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-10 03:01:47 +0100
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-10 03:01:47 +0100
commitcfd5dcb231d55478442c7b80517064b377eda43d (patch)
tree88530adc2a3e05ae7d10f6dbaa44377e6dc56444 /module/plugins/internal
parentSpare code cosmetics (diff)
downloadpyload-cfd5dcb231d55478442c7b80517064b377eda43d.tar.xz
[RapidgatorNet] Fix https://github.com/pyload/pyload/issues/1237
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/SimpleHoster.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index df6e78485..2754b0b18 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -237,7 +237,7 @@ def secondsToMidnight(gmt=0):
if hasattr(td, 'total_seconds'):
res = td.total_seconds()
- else: #@NOTE: work-around for python 2.5 and 2.6 missing timedelta.total_seconds
+ else: #: work-around for python 2.5 and 2.6 missing timedelta.total_seconds
res = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
return int(res)
@@ -246,7 +246,7 @@ def secondsToMidnight(gmt=0):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "1.16"
+ __version__ = "1.17"
__pattern__ = r'^unmatchable$'
@@ -537,8 +537,22 @@ class SimpleHoster(Hoster):
elif hasattr(self, 'ERROR_PATTERN'):
m = re.search(self.ERROR_PATTERN, self.html)
if m:
- errmsg = self.info['error'] = m.group(1)
- self.error(errmsg)
+ errmsg
+ try:
+ errmsg = m.group(1)
+ except Exception:
+ errmsg = m.group(0)
+
+ self.info['error'] = errmsg
+
+ if "hour" in errmsg
+ self.wait(secondsToMidnight(gmt=2), True)
+
+ elif re.search("da(il)?y|today", errmsg):
+ self.wait(1 * 60 * 60, True)
+
+ else:
+ self.error(errmsg)
elif hasattr(self, 'WAIT_PATTERN'):
m = re.search(self.WAIT_PATTERN, self.html)
@@ -546,7 +560,6 @@ class SimpleHoster(Hoster):
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))
self.wait(wait_time, wait_time > 300)
- return
self.info.pop('error', None)