From b5bff211b15187ff01dacaacdc022dc917d48b81 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 11 Apr 2014 12:17:03 +0200 Subject: Fix retry time formats Merges vuolter/pyload@498b9e3 (cherry picked from commit 381c4d02a900fac224ccaa802db080cf577ed2fb) --- pyload/plugins/accounts/AlldebridCom.py | 2 +- pyload/plugins/accounts/HotfileCom.py | 2 +- pyload/plugins/accounts/MultiDebridCom.py | 2 +- pyload/plugins/accounts/UploadedTo.py | 4 ++-- pyload/plugins/addons/Checksum.py | 2 +- pyload/plugins/hoster/AlldebridCom.py | 4 ++-- pyload/plugins/hoster/BayfilesCom.py | 4 ++-- pyload/plugins/hoster/DebridItaliaCom.py | 2 +- pyload/plugins/hoster/DepositfilesCom.py | 2 +- pyload/plugins/hoster/FastixRu.py | 4 ++-- pyload/plugins/hoster/FastshareCz.py | 4 ++-- pyload/plugins/hoster/FilecloudIo.py | 2 +- pyload/plugins/hoster/FilefactoryCom.py | 4 ++-- pyload/plugins/hoster/FilepostCom.py | 4 ++-- pyload/plugins/hoster/FilerNet.py | 2 +- pyload/plugins/hoster/FileserveCom.py | 6 +++--- pyload/plugins/hoster/FreakshareCom.py | 4 ++-- pyload/plugins/hoster/FshareVn.py | 4 ++-- pyload/plugins/hoster/Keep2shareCC.py | 2 +- pyload/plugins/hoster/LuckyShareNet.py | 2 +- pyload/plugins/hoster/MegasharesCom.py | 8 ++++---- pyload/plugins/hoster/Premium4Me.py | 2 +- pyload/plugins/hoster/QuickshareCz.py | 4 ++-- pyload/plugins/hoster/RealdebridCom.py | 2 +- pyload/plugins/hoster/ReloadCc.py | 8 ++++---- pyload/plugins/hoster/ShareRapidCom.py | 4 ++-- pyload/plugins/hoster/ShareonlineBiz.py | 6 +++--- pyload/plugins/hoster/SimplydebridCom.py | 2 +- pyload/plugins/hoster/UploadedTo.py | 2 +- pyload/plugins/hoster/UploadheroCom.py | 2 +- pyload/plugins/hoster/UploadingCom.py | 2 +- pyload/plugins/hoster/XFileSharingPro.py | 2 +- pyload/plugins/hoster/ZippyshareCom.py | 2 +- 33 files changed, 54 insertions(+), 54 deletions(-) diff --git a/pyload/plugins/accounts/AlldebridCom.py b/pyload/plugins/accounts/AlldebridCom.py index ea173d19d..a0a518ce1 100644 --- a/pyload/plugins/accounts/AlldebridCom.py +++ b/pyload/plugins/accounts/AlldebridCom.py @@ -34,7 +34,7 @@ class AlldebridCom(MultiHoster): data["password"])) self.logDebug(page) xml = dom.parseString(page) - exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 86400 + exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 account_info = {"validuntil": exp_time, "trafficleft": -1} return account_info diff --git a/pyload/plugins/accounts/HotfileCom.py b/pyload/plugins/accounts/HotfileCom.py index 72a04777f..7188e6758 100644 --- a/pyload/plugins/accounts/HotfileCom.py +++ b/pyload/plugins/accounts/HotfileCom.py @@ -47,7 +47,7 @@ class HotfileCom(Account): info["premium_until"] = info["premium_until"][:19] zone = int(zone[:3]) - validuntil = int(mktime(strptime(info["premium_until"], "%Y-%m-%d %H:%M:%S"))) + (zone * 3600) + validuntil = int(mktime(strptime(info["premium_until"], "%Y-%m-%d %H:%M:%S"))) + (zone * 60 * 60) tmp = {"validuntil": validuntil, "trafficleft": -1, "premium": True} elif info['is_premium'] == '0': diff --git a/pyload/plugins/accounts/MultiDebridCom.py b/pyload/plugins/accounts/MultiDebridCom.py index 5d3536684..0c7b1d230 100644 --- a/pyload/plugins/accounts/MultiDebridCom.py +++ b/pyload/plugins/accounts/MultiDebridCom.py @@ -31,7 +31,7 @@ class MultiDebridCom(MultiHoster): def loadAccountInfo(self, user, req): if 'days_left' in self.json_data: - validuntil = int(time() + self.json_data['days_left'] * 86400) + validuntil = int(time() + self.json_data['days_left'] * 24 * 60 * 60) return {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: self.logError('Unable to get account information') diff --git a/pyload/plugins/accounts/UploadedTo.py b/pyload/plugins/accounts/UploadedTo.py index 83bfb3f14..b6058115b 100644 --- a/pyload/plugins/accounts/UploadedTo.py +++ b/pyload/plugins/accounts/UploadedTo.py @@ -50,8 +50,8 @@ class UploadedTo(Account): raw_valid = re.findall(r"(\d+) (Week|weeks|days|day|hours|hour)", raw_valid) validuntil = time() for n, u in raw_valid: - validuntil += 3600 * int(n) * {"Week": 168, "weeks": 168, "days": 24, - "day": 24, "hours": 1, "hour": 1}[u] + validuntil += int(n) * 60 * 60 * {"Week": 168, "weeks": 168, "days": 24, + "day": 24, "hours": 1, "hour": 1}[u] return {"validuntil": validuntil, "trafficleft": traffic, "maxtraffic": 50 * 1024 * 1024} else: diff --git a/pyload/plugins/addons/Checksum.py b/pyload/plugins/addons/Checksum.py index fb7087de9..af37d69e6 100644 --- a/pyload/plugins/addons/Checksum.py +++ b/pyload/plugins/addons/Checksum.py @@ -145,7 +145,7 @@ class Checksum(Hook): if pyfile.plugin.retries < max_tries: if local_file: remove(local_file) - pyfile.plugin.retry(reason=msg, max_tries=max_tries, wait_time=self.getConfig("wait_time")) + pyfile.plugin.retry(max_tries=max_tries, wait_time=self.getConfig("wait_time"), reason=msg) elif retry_action == "nothing": return elif check_action == "nothing": diff --git a/pyload/plugins/hoster/AlldebridCom.py b/pyload/plugins/hoster/AlldebridCom.py index 7634c2460..13bfb018c 100644 --- a/pyload/plugins/hoster/AlldebridCom.py +++ b/pyload/plugins/hoster/AlldebridCom.py @@ -78,6 +78,6 @@ class AlldebridCom(Hoster): "empty": re.compile(r"^$")}) if check == "error": - self.retry(reason="An error occured while generating link.", wait_time=60) + self.retry(wait_time=60, reason="An error occured while generating link.") elif check == "empty": - self.retry(reason="Downloaded File was empty.", wait_time=60) + self.retry(wait_time=60, reason="Downloaded File was empty.") diff --git a/pyload/plugins/hoster/BayfilesCom.py b/pyload/plugins/hoster/BayfilesCom.py index 849370f3f..f1b36221f 100644 --- a/pyload/plugins/hoster/BayfilesCom.py +++ b/pyload/plugins/hoster/BayfilesCom.py @@ -90,9 +90,9 @@ class BayfilesCom(SimpleHoster): "notfound": re.compile(r"404 Not Found") }) if check == "waitforfreeslots": - self.retry(30, 60 * 5, "Wait for free slot") + self.retry(30, 5 * 60, "Wait for free slot") elif check == "notfound": - self.retry(30, 60 * 5, "404 Not found") + self.retry(30, 5 * 60, "404 Not found") getInfo = create_getInfo(BayfilesCom) diff --git a/pyload/plugins/hoster/DebridItaliaCom.py b/pyload/plugins/hoster/DebridItaliaCom.py index 0e68984d9..441151b99 100644 --- a/pyload/plugins/hoster/DebridItaliaCom.py +++ b/pyload/plugins/hoster/DebridItaliaCom.py @@ -63,4 +63,4 @@ class DebridItaliaCom(Hoster): check = self.checkDownload({"empty": re.compile(r"^$")}) if check == "empty": - self.retry(5, 120, 'Empty file downloaded') + self.retry(5, 2 * 60, "Empty file downloaded") diff --git a/pyload/plugins/hoster/DepositfilesCom.py b/pyload/plugins/hoster/DepositfilesCom.py index 20d88f8a0..f1b3d18e5 100644 --- a/pyload/plugins/hoster/DepositfilesCom.py +++ b/pyload/plugins/hoster/DepositfilesCom.py @@ -103,7 +103,7 @@ class DepositfilesCom(SimpleHoster): def handlePremium(self): if '' in self.html: self.logWarning("Download limit reached") - self.retry(25, 3600, "Download limit reached") + self.retry(25, 60 * 60, "Download limit reached") elif 'onClick="show_gold_offer' in self.html: self.account.relogin(self.user) self.retry() diff --git a/pyload/plugins/hoster/FastixRu.py b/pyload/plugins/hoster/FastixRu.py index 39091d769..ef8838f8e 100644 --- a/pyload/plugins/hoster/FastixRu.py +++ b/pyload/plugins/hoster/FastixRu.py @@ -61,6 +61,6 @@ class FastixRu(Hoster): "empty": re.compile(r"^$")}) if check == "error": - self.retry(reason="An error occurred while generating link.", wait_time=60) + self.retry(wait_time=60, reason="An error occurred while generating link.") elif check == "empty": - self.retry(reason="Downloaded File was empty.", wait_time=60) + self.retry(wait_time=60, reason="Downloaded File was empty.") diff --git a/pyload/plugins/hoster/FastshareCz.py b/pyload/plugins/hoster/FastshareCz.py index 93fbad6be..4418aa29c 100644 --- a/pyload/plugins/hoster/FastshareCz.py +++ b/pyload/plugins/hoster/FastshareCz.py @@ -66,9 +66,9 @@ class FastshareCz(SimpleHoster): }) if check == "paralell_dl": - self.retry(6, 600, "Paralell download") + self.retry(6, 10 * 60, "Paralell download") elif check == "wrong_captcha": - self.retry(5, 1, "Wrong captcha") + self.retry(max_tries=5, reason="Wrong captcha") def handlePremium(self): header = self.load(self.pyfile.url, just_header=True) diff --git a/pyload/plugins/hoster/FilecloudIo.py b/pyload/plugins/hoster/FilecloudIo.py index 8ccef67e1..dbf925c14 100644 --- a/pyload/plugins/hoster/FilecloudIo.py +++ b/pyload/plugins/hoster/FilecloudIo.py @@ -63,7 +63,7 @@ class FilecloudIo(SimpleHoster): self.account.form_data = {"recaptcha_challenge_field": captcha_challenge, "recaptcha_response_field": captcha_response} self.account.relogin(self.user) - self.retry(max_tries=2) + self.retry(2) json_url = "http://filecloud.io/download-request.json" response = self.load(json_url, post=data) diff --git a/pyload/plugins/hoster/FilefactoryCom.py b/pyload/plugins/hoster/FilefactoryCom.py index 8e0bd2494..97204a1a2 100644 --- a/pyload/plugins/hoster/FilefactoryCom.py +++ b/pyload/plugins/hoster/FilefactoryCom.py @@ -39,7 +39,7 @@ class FilefactoryCom(SimpleHoster): if "Currently only Premium Members can download files larger than" in self.html: self.fail("File too large for free download") elif "All free download slots on this server are currently in use" in self.html: - self.retry(50, 900, "All free slots are busy") + self.retry(50, 15 * 60, "All free slots are busy") m = re.search(r'data-href-direct="(http://[^"]+)"', self.html) if m: @@ -80,7 +80,7 @@ class FilefactoryCom(SimpleHoster): if check == "multiple": self.logDebug("Parallel downloads detected; waiting 15 minutes") - self.retry(wait_time=15 * 60, reason='Parallel downloads') + self.retry(wait_time=15 * 60, reason="Parallel downloads") elif check == "error": self.fail("Unknown error") diff --git a/pyload/plugins/hoster/FilepostCom.py b/pyload/plugins/hoster/FilepostCom.py index 1deec2c18..e18455255 100644 --- a/pyload/plugins/hoster/FilepostCom.py +++ b/pyload/plugins/hoster/FilepostCom.py @@ -122,8 +122,8 @@ class FilepostCom(SimpleHoster): # see the two lines commented out with "# ~?". if 'error' in json_response['js']: if json_response['js']['error'] == 'download_delay': - self.retry(json_response['js']['params']['next_download']) - # ~? self.retry(js_answer['params']['next_download']) + self.retry(wait_time=json_response['js']['params']['next_download']) + # ~? self.retry(wait_time=js_answer['params']['next_download']) elif 'Wrong file password' in json_response['js']['error']: return None elif 'You entered a wrong CAPTCHA code' in json_response['js']['error']: diff --git a/pyload/plugins/hoster/FilerNet.py b/pyload/plugins/hoster/FilerNet.py index 3a9251fb3..5eaa19785 100644 --- a/pyload/plugins/hoster/FilerNet.py +++ b/pyload/plugins/hoster/FilerNet.py @@ -55,7 +55,7 @@ class FilerNet(SimpleHoster): m = re.search(r'musst du (\d+) Sekunden warten', self.html) if m: waittime = int(m.group(1)) - self.retry(3, waittime, 'Wait between free downloads') + self.retry(3, waittime, "Wait between free downloads") self.getFileInfo() diff --git a/pyload/plugins/hoster/FileserveCom.py b/pyload/plugins/hoster/FileserveCom.py index 6697c133f..30471d69f 100644 --- a/pyload/plugins/hoster/FileserveCom.py +++ b/pyload/plugins/hoster/FileserveCom.py @@ -133,9 +133,9 @@ class FileserveCom(Hoster): self.doLongWait(self.lastCheck) elif check == "limit": #download limited reached for today (not a exact time known) - self.setWait(180 * 60, True) # wait 3 hours + self.setWait(3 * 60 * 60, True) # wait 3 hours #TO-DO: resolve waittime using UnrestrictLi's secondsToMidnight self.wait() - self.retry(max_tries=0) + self.retry() self.thread.m.reconnecting.wait(3) # Ease issue with later downloads appearing to be in parallel @@ -178,7 +178,7 @@ class FileserveCom(Hoster): self.fail("Invalid captcha") def doLongWait(self, m): - wait_time = (int(m.group(1)) * {'seconds': 1, 'minutes': 60, 'hours': 3600}[m.group(2)]) if m else 720 + wait_time = (int(m.group(1)) * {'seconds': 1, 'minutes': 60, 'hours': 3600}[m.group(2)]) if m else 12 * 60 self.setWait(wait_time, True) self.wait() self.retry() diff --git a/pyload/plugins/hoster/FreakshareCom.py b/pyload/plugins/hoster/FreakshareCom.py index 2dcd9ee48..f4ed4958f 100644 --- a/pyload/plugins/hoster/FreakshareCom.py +++ b/pyload/plugins/hoster/FreakshareCom.py @@ -53,7 +53,7 @@ class FreakshareCom(Hoster): self.invalidCaptcha() self.retry() elif check == "downloadserver": - self.retry(5, 900, 'No Download server') + self.retry(5, 15 * 60, "No Download server") def prepare(self): pyfile = self.pyfile @@ -123,7 +123,7 @@ class FreakshareCom(Hoster): if "Your Traffic is used up for today" in self.html: self.wantReconnect = True - return 24 * 3600 + return 24 * 60 * 60 timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[.\d]*;', self.html) if timestring: diff --git a/pyload/plugins/hoster/FshareVn.py b/pyload/plugins/hoster/FshareVn.py index 6b73f1975..34539f965 100644 --- a/pyload/plugins/hoster/FshareVn.py +++ b/pyload/plugins/hoster/FshareVn.py @@ -100,12 +100,12 @@ class FshareVn(SimpleHoster): if found: self.logInfo("Wait until %s ICT" % found.group(1)) wait_until = mktime(strptime(found.group(1), "%d/%m/%Y %H:%M")) - self.setWait(wait_until - mktime(gmtime()) - 7 * 3600, True) + self.setWait(wait_until - mktime(gmtime()) - 7 * 60 * 60, True) self.wait() self.retry() elif '