diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-04-11 12:17:38 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2014-04-21 17:20:14 +0200 |
commit | 52b5c2a15b2dfa9bcc2ffdcc90b8e3f29fdaa7d8 (patch) | |
tree | be392f70e0d628a97e793ef47080e0669420e33a | |
parent | Fix retry time formats (diff) | |
download | pyload-52b5c2a15b2dfa9bcc2ffdcc90b8e3f29fdaa7d8.tar.xz |
Use wait to set time in SimpleHoster plugins
Merges vuolter/pyload@bb002ac
(cherry picked from commit 7f1467c64fe5c0e902498b3252afd65cb68ed2f9)
30 files changed, 45 insertions, 86 deletions
diff --git a/pyload/plugins/hoster/BayfilesCom.py b/pyload/plugins/hoster/BayfilesCom.py index f1b36221f..2254ffb1e 100644 --- a/pyload/plugins/hoster/BayfilesCom.py +++ b/pyload/plugins/hoster/BayfilesCom.py @@ -43,8 +43,7 @@ class BayfilesCom(SimpleHoster): def handleFree(self): found = re.search(self.WAIT_PATTERN, self.html) if found: - self.setWait(int(found.group(1)) * 60) - self.wait() + self.wait(int(found.group(1)) * 60) self.retry() # Get download token @@ -61,8 +60,7 @@ class BayfilesCom(SimpleHoster): if not "token" in response or not response['token']: self.fail('No token') - self.setWait(int(delay)) - self.wait() + self.wait(int(delay)) self.html = self.load('https://bayfiles.com/ajax_download', get={ "token": response['token'], diff --git a/pyload/plugins/hoster/BezvadataCz.py b/pyload/plugins/hoster/BezvadataCz.py index e6cd4c809..656f45fd3 100644 --- a/pyload/plugins/hoster/BezvadataCz.py +++ b/pyload/plugins/hoster/BezvadataCz.py @@ -83,14 +83,13 @@ class BezvadataCz(SimpleHoster): #countdown found = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html) wait_time = (int(found.group(1)) * 60 + int(found.group(2)) + 1) if found else 120 - self.setWait(wait_time, False) - self.wait() + self.wait(wait_time, False) self.download(url) def checkErrors(self): if 'images/button-download-disable.png' in self.html: - self.longWait(300, 24) # parallel dl limit + self.longWait(5 * 60, 24) # parallel dl limit elif '<div class="infobox' in self.html: self.tempOffline() diff --git a/pyload/plugins/hoster/BitshareCom.py b/pyload/plugins/hoster/BitshareCom.py index d48329c0d..2cbbc895f 100644 --- a/pyload/plugins/hoster/BitshareCom.py +++ b/pyload/plugins/hoster/BitshareCom.py @@ -50,9 +50,7 @@ class BitshareCom(SimpleHoster): if re.search(self.TRAFFIC_USED_UP, self.html): self.logInfo("Your Traffic is used up for today. Wait 1800 seconds or reconnect!") self.logDebug("Waiting %d seconds." % 1800) - self.setWait(1800, True) - self.wantReconnect = True - self.wait() + self.wait(30 * 60, True) self.retry() # File name @@ -93,11 +91,9 @@ class BitshareCom(SimpleHoster): if wait > 0: self.logDebug("Waiting %d seconds." % wait) if wait < 120: - self.setWait(wait, False) - self.wait() + self.wait(wait, False) else: - self.setWait(wait - 55, True) - self.wait() + self.wait(wait - 55, True) self.retry() # Resolve captcha diff --git a/pyload/plugins/hoster/CatShareNet.py b/pyload/plugins/hoster/CatShareNet.py index 4419779e3..e0a424b93 100644 --- a/pyload/plugins/hoster/CatShareNet.py +++ b/pyload/plugins/hoster/CatShareNet.py @@ -23,8 +23,7 @@ class CatShareNet(SimpleHoster): found = re.search(self.SECONDS_PATTERN, self.html) seconds = int(found.group(1)) self.logDebug("Seconds found", seconds) - self.setWait(seconds + 1) - self.wait() + self.wait(seconds + 1) recaptcha = ReCaptcha(self) challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY) post_data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": code} diff --git a/pyload/plugins/hoster/CrockoCom.py b/pyload/plugins/hoster/CrockoCom.py index 569cef01d..8bd21f041 100644 --- a/pyload/plugins/hoster/CrockoCom.py +++ b/pyload/plugins/hoster/CrockoCom.py @@ -35,8 +35,7 @@ class CrockoCom(SimpleHoster): found = re.search(self.CAPTCHA_URL_PATTERN, self.html) if found: url, wait_time = 'http://crocko.com' + found.group(1), found.group(2) - self.setWait(wait_time) - self.wait() + self.wait(wait_time) self.html = self.load(url) else: break diff --git a/pyload/plugins/hoster/CzshareCom.py b/pyload/plugins/hoster/CzshareCom.py index 763bbbd29..4082ed0b9 100644 --- a/pyload/plugins/hoster/CzshareCom.py +++ b/pyload/plugins/hoster/CzshareCom.py @@ -96,7 +96,7 @@ class CzshareCom(SimpleHoster): # get download ticket and parse html self.html = self.load(parsed_url, cookies=True, decode=True) if re.search(self.MULTIDL_PATTERN, self.html): - self.longWait(300, 12) + self.longWait(5 * 60, 12) try: form = re.search(self.FREE_FORM_PATTERN, self.html, re.DOTALL).group(1) @@ -114,7 +114,7 @@ class CzshareCom(SimpleHoster): if u"<li>Zadaný ověřovací kód nesouhlasí!</li>" in self.html: self.invalidCaptcha() elif re.search(self.MULTIDL_PATTERN, self.html): - self.longWait(300, 12) + self.longWait(5 * 60, 12) else: self.correctCaptcha() break @@ -150,7 +150,7 @@ class CzshareCom(SimpleHoster): if check == "credit": self.resetAccount() elif check == "multi_dl": - self.longWait(300, 12) + self.longWait(5 * 60, 12) elif check == "captcha_err": self.invalidCaptcha() self.retry() diff --git a/pyload/plugins/hoster/DataportCz.py b/pyload/plugins/hoster/DataportCz.py index ebd5d13a8..000bd79a7 100644 --- a/pyload/plugins/hoster/DataportCz.py +++ b/pyload/plugins/hoster/DataportCz.py @@ -58,8 +58,7 @@ class DataportCz(SimpleHoster): raise PluginParseError('invalid captcha') elif check == "slot": self.logDebug("No free slots - wait 60s and retry") - self.setWait(60, False) - self.wait() + self.wait(60, False) self.html = self.load(self.pyfile.url, decode=True) continue else: diff --git a/pyload/plugins/hoster/DateiTo.py b/pyload/plugins/hoster/DateiTo.py index c08b775a4..f39f6a6fb 100644 --- a/pyload/plugins/hoster/DateiTo.py +++ b/pyload/plugins/hoster/DateiTo.py @@ -81,17 +81,15 @@ class DateiTo(SimpleHoster): if found: found = re.search(self.WAIT_PATTERN, self.html) wait_time = int(found.group(1)) if found else 30 - self.setWait(wait_time + 1, False) - self.wait(300) + self.wait(wait_time + 1, False) self.retry() def doWait(self): found = re.search(self.WAIT_PATTERN, self.html) wait_time = int(found.group(1)) if found else 30 - self.setWait(wait_time + 1, False) self.load('http://datei.to/ajax/download.php', post={'P': 'Ads'}) - self.wait() + self.wait(wait_time + 1, False) getInfo = create_getInfo(DateiTo) diff --git a/pyload/plugins/hoster/DepositfilesCom.py b/pyload/plugins/hoster/DepositfilesCom.py index f1b3d18e5..a05dd983a 100644 --- a/pyload/plugins/hoster/DepositfilesCom.py +++ b/pyload/plugins/hoster/DepositfilesCom.py @@ -33,17 +33,14 @@ class DepositfilesCom(SimpleHoster): if re.search(r'File is checked, please try again in a minute.', self.html) is not None: self.logInfo("DepositFiles.com: The file is being checked. Waiting 1 minute.") - self.setWait(61) - self.wait() + self.wait(61) self.retry() wait = re.search(r'html_download_api-limit_interval\">(\d+)</span>', self.html) if wait: wait_time = int(wait.group(1)) self.logInfo("%s: Traffic used up. Waiting %d seconds." % (self.__name__, wait_time)) - self.setWait(wait_time) - self.wantReconnect = True - self.wait() + self.wait(wait_time, True) self.retry() wait = re.search(r'>Try in (\d+) minutes or use GOLD account', self.html) diff --git a/pyload/plugins/hoster/EgoFilesCom.py b/pyload/plugins/hoster/EgoFilesCom.py index 5d02d244e..035102c3c 100644 --- a/pyload/plugins/hoster/EgoFilesCom.py +++ b/pyload/plugins/hoster/EgoFilesCom.py @@ -57,8 +57,7 @@ class EgoFilesCom(SimpleHoster): if 'For next free download you have to wait' in self.html: m = re.search(self.WAIT_TIME_PATTERN, self.html).groupdict('0') waittime = int(m['m']) * 60 + int(m['s']) - self.setWait(waittime, True) - self.wait() + self.wait((waittime, True) downloadURL = '' recaptcha = ReCaptcha(self) diff --git a/pyload/plugins/hoster/EuroshareEu.py b/pyload/plugins/hoster/EuroshareEu.py index 646e8607e..45e10880e 100644 --- a/pyload/plugins/hoster/EuroshareEu.py +++ b/pyload/plugins/hoster/EuroshareEu.py @@ -59,7 +59,7 @@ class EuroshareEu(SimpleHoster): def handleFree(self): if re.search(self.ERR_PARDL_PATTERN, self.html) is not None: - self.longWait(300, 12) + self.longWait(5 * 60, 12) found = re.search(self.FREE_URL_PATTERN, self.html) if found is None: @@ -70,7 +70,7 @@ class EuroshareEu(SimpleHoster): check = self.checkDownload({"multi_dl": re.compile(self.ERR_PARDL_PATTERN)}) if check == "multi_dl": - self.longWait(300, 12) + self.longWait(5 * 60, 12) getInfo = create_getInfo(EuroshareEu) diff --git a/pyload/plugins/hoster/ExtabitCom.py b/pyload/plugins/hoster/ExtabitCom.py index d9724ddb7..328095711 100644 --- a/pyload/plugins/hoster/ExtabitCom.py +++ b/pyload/plugins/hoster/ExtabitCom.py @@ -45,11 +45,9 @@ class ExtabitCom(SimpleHoster): m = re.search(r"Next free download from your ip will be available in <b>(\d+)\s*minutes", self.html) if m: - self.setWait(int(m.group(1)) * 60, True) - self.wait() + self.wait(int(m.group(1)) * 60, True) elif "The daily downloads limit from your IP is exceeded" in self.html: - self.setWait(3600, True) - self.wait() + self.wait(1 * 60 * 60, True) self.logDebug("URL: " + self.req.http.lastEffectiveURL) m = re.match(self.__pattern__, self.req.http.lastEffectiveURL) diff --git a/pyload/plugins/hoster/FilefactoryCom.py b/pyload/plugins/hoster/FilefactoryCom.py index 97204a1a2..01119739b 100644 --- a/pyload/plugins/hoster/FilefactoryCom.py +++ b/pyload/plugins/hoster/FilefactoryCom.py @@ -63,8 +63,7 @@ class FilefactoryCom(SimpleHoster): waittime = re.search(r'id="startWait" value="(\d+)"', self.html) if not waittime: self.parseError('Unable to detect wait time') - self.setWait(int(waittime.group(1))) - self.wait() + self.wait(int(waittime.group(1))) # Parse the direct link and download it direct = re.search(r'data-href-direct="(.*)" class="button', self.html) diff --git a/pyload/plugins/hoster/FilepostCom.py b/pyload/plugins/hoster/FilepostCom.py index e18455255..191da7849 100644 --- a/pyload/plugins/hoster/FilepostCom.py +++ b/pyload/plugins/hoster/FilepostCom.py @@ -64,8 +64,7 @@ class FilepostCom(SimpleHoster): wait_time = int(self.getJsonResponse(get_dict, post_dict, 'wait_time')) if wait_time > 0: - self.setWait(wait_time) - self.wait() + self.wait(wait_time) post_dict = {"token": flp_token, "code": file_id, "file_pass": ''} diff --git a/pyload/plugins/hoster/FlyFilesNet.py b/pyload/plugins/hoster/FlyFilesNet.py index 8d0ff0a08..ceb5555ca 100644 --- a/pyload/plugins/hoster/FlyFilesNet.py +++ b/pyload/plugins/hoster/FlyFilesNet.py @@ -31,8 +31,7 @@ class FlyFilesNet(SimpleHoster): if parsed_url == '#downlink|' or parsed_url == "#downlink|#": self.logWarning("Could not get the download URL. Please wait 10 minutes.") - self.setWait(600, True) # wait 10 minutes - self.wait() + self.wait(10 * 60, True) self.retry() download_url = parsed_url.replace('#downlink|', '') diff --git a/pyload/plugins/hoster/FourSharedCom.py b/pyload/plugins/hoster/FourSharedCom.py index d1414347f..13848acc1 100644 --- a/pyload/plugins/hoster/FourSharedCom.py +++ b/pyload/plugins/hoster/FourSharedCom.py @@ -49,8 +49,7 @@ class FourSharedCom(SimpleHoster): except: pass - self.setWait(20) - self.wait() + self.wait(20) self.download(link) diff --git a/pyload/plugins/hoster/FshareVn.py b/pyload/plugins/hoster/FshareVn.py index 34539f965..1f892ca7c 100644 --- a/pyload/plugins/hoster/FshareVn.py +++ b/pyload/plugins/hoster/FshareVn.py @@ -100,8 +100,7 @@ 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 * 60 * 60, True) - self.wait() + self.wait(wait_until - mktime(gmtime()) - 7 * 60 * 60, True) self.retry() elif '<ul class="message-error">' in self.html: self.logError("Unknown error occured or wait time not parsed") diff --git a/pyload/plugins/hoster/GigapetaCom.py b/pyload/plugins/hoster/GigapetaCom.py index 1472fbb1d..c7dfb7984 100644 --- a/pyload/plugins/hoster/GigapetaCom.py +++ b/pyload/plugins/hoster/GigapetaCom.py @@ -68,8 +68,7 @@ class GigapetaCom(SimpleHoster): def checkErrors(self): if "All threads for IP" in self.html: self.logDebug("Your IP is already downloading a file - wait and retry") - self.setWait(300, True) - self.wait() + self.wait(5 * 60, True) self.retry() diff --git a/pyload/plugins/hoster/GooIm.py b/pyload/plugins/hoster/GooIm.py index f0051b082..a412821f2 100644 --- a/pyload/plugins/hoster/GooIm.py +++ b/pyload/plugins/hoster/GooIm.py @@ -41,8 +41,7 @@ class GooIm(SimpleHoster): m = re.search(r'MD5sum: (?P<MD5>[0-9a-z]{32})</h3>', self.html) if m: self.check_data = {"md5": m.group('MD5')} - self.setWait(10) - self.wait() + self.wait(10) header = self.load(self.pyfile.url, just_header=True) if header['location']: diff --git a/pyload/plugins/hoster/IfolderRu.py b/pyload/plugins/hoster/IfolderRu.py index 3a0290591..d128f427b 100644 --- a/pyload/plugins/hoster/IfolderRu.py +++ b/pyload/plugins/hoster/IfolderRu.py @@ -58,8 +58,7 @@ class IfolderRu(SimpleHoster): url = "http://ints.rusfolder.com/ints/frame/?session=%s" % session_id self.html = self.load(url, cookies=True) - self.setWait(31, False) - self.wait() + self.wait(31, False) captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id for _ in xrange(5): diff --git a/pyload/plugins/hoster/LetitbitNet.py b/pyload/plugins/hoster/LetitbitNet.py index d2ef616a8..2475c31fe 100644 --- a/pyload/plugins/hoster/LetitbitNet.py +++ b/pyload/plugins/hoster/LetitbitNet.py @@ -97,8 +97,7 @@ class LetitbitNet(SimpleHoster): # ajax_check_url, captcha_url = re.search(self.CHECK_URL_PATTERN, self.html).groups() # found = re.search(self.SECONDS_PATTERN, self.html) # seconds = int(found.group(1)) if found else 60 - # self.setWait(seconds+1) - # self.wait() + # self.wait(seconds+1) # except Exception, e: # self.logError(e) # self.parseError("page 3 / js") @@ -109,8 +108,7 @@ class LetitbitNet(SimpleHoster): found = re.search(self.CAPTCHA_CONTROL_FIELD, self.html) recaptcha_control_field = found.group(1) self.logDebug("ReCaptcha control field found", recaptcha_control_field) - self.setWait(seconds + 1) - self.wait() + self.wait(seconds + 1) response = self.load("%s/ajax/download3.php" % self.DOMAIN, post=" ", cookies=True) if response != '1': @@ -128,8 +126,7 @@ class LetitbitNet(SimpleHoster): self.invalidCaptcha() if response == "error_free_download_blocked": self.logInfo("Daily limit reached, waiting 24 hours") - self.setWait(24 * 60 * 60) - self.wait() + self.wait(24 * 60 * 60) if response == "error_wrong_captcha": self.logInfo("Wrong Captcha") self.invalidCaptcha() diff --git a/pyload/plugins/hoster/LuckyShareNet.py b/pyload/plugins/hoster/LuckyShareNet.py index 271d166c0..1257656e7 100644 --- a/pyload/plugins/hoster/LuckyShareNet.py +++ b/pyload/plugins/hoster/LuckyShareNet.py @@ -43,8 +43,7 @@ class LuckyShareNet(SimpleHoster): self.logDebug('JSON: ' + rep) json = self.parseJson(rep) - self.setWait(int(json['time'])) - self.wait() + self.wait(int(json['time'])) recaptcha = ReCaptcha(self) for _ in xrange(5): diff --git a/pyload/plugins/hoster/NowDownloadEu.py b/pyload/plugins/hoster/NowDownloadEu.py index dda13e2da..8a62fed88 100644 --- a/pyload/plugins/hoster/NowDownloadEu.py +++ b/pyload/plugins/hoster/NowDownloadEu.py @@ -57,8 +57,7 @@ class NowDownloadEu(SimpleHoster): baseurl = "http://www.nowdownload.ch" self.html = self.load(baseurl + str(tokenlink.group(1))) - self.setWait(wait) - self.wait() + self.wait(wait) self.html = self.load(baseurl + str(continuelink.group(1))) diff --git a/pyload/plugins/hoster/OneFichierCom.py b/pyload/plugins/hoster/OneFichierCom.py index 5b69db63d..e16793cf7 100644 --- a/pyload/plugins/hoster/OneFichierCom.py +++ b/pyload/plugins/hoster/OneFichierCom.py @@ -69,8 +69,7 @@ class OneFichierCom(SimpleHoster): self.waitAndRetry(int(self.lastcheck.group(1)) * 60) def waitAndRetry(self, wait_time): - self.setWait(wait_time, True) - self.wait() + self.wait(wait_time, True) self.retry() def setup(self): diff --git a/pyload/plugins/hoster/TurbobitNet.py b/pyload/plugins/hoster/TurbobitNet.py index 5bed39712..7547d96a1 100644 --- a/pyload/plugins/hoster/TurbobitNet.py +++ b/pyload/plugins/hoster/TurbobitNet.py @@ -74,8 +74,7 @@ class TurbobitNet(SimpleHoster): found = re.search(self.LIMIT_WAIT_PATTERN, self.html) if found: wait_time = int(found.group(1)) - self.setWait(wait_time, wait_time > 60) - self.wait() + self.wait(wait_time, wait_time > 60) self.retry() action, inputs = self.parseHtmlForm("action='#'") diff --git a/pyload/plugins/hoster/UlozTo.py b/pyload/plugins/hoster/UlozTo.py index 4e2db527a..71a341b76 100644 --- a/pyload/plugins/hoster/UlozTo.py +++ b/pyload/plugins/hoster/UlozTo.py @@ -158,8 +158,7 @@ class UlozTo(SimpleHoster): elif check == "server_error": self.logError("Server error, try downloading later") self.multiDL = False - self.setWait(3600, True) - self.wait() + self.wait(1 * 60 * 60, True) self.retry() elif check == "not_found": self.fail("Server error - file not downloadable") diff --git a/pyload/plugins/hoster/UnibytesCom.py b/pyload/plugins/hoster/UnibytesCom.py index c7deba89c..05921e13a 100644 --- a/pyload/plugins/hoster/UnibytesCom.py +++ b/pyload/plugins/hoster/UnibytesCom.py @@ -50,8 +50,7 @@ class UnibytesCom(SimpleHoster): break if '>Somebody else is already downloading using your IP-address<' in self.html: - self.setWait(600, True) - self.wait() + self.wait(10 * 60, True) self.retry() if post_data['step'] == 'last': @@ -68,8 +67,7 @@ class UnibytesCom(SimpleHoster): if last_step == 'timer': found = re.search(self.WAIT_PATTERN, self.html) - self.setWait(int(found.group(1)) if found else 60, False) - self.wait() + self.wait(int(found.group(1)) if found else 60, False) elif last_step in ('captcha', 'last'): post_data['captcha'] = self.decryptCaptcha(self.DOMAIN + '/captcha.jpg') else: diff --git a/pyload/plugins/hoster/UploadheroCom.py b/pyload/plugins/hoster/UploadheroCom.py index 053705c05..1df6ca4fe 100644 --- a/pyload/plugins/hoster/UploadheroCom.py +++ b/pyload/plugins/hoster/UploadheroCom.py @@ -82,8 +82,7 @@ class UploadheroCom(SimpleHoster): found = re.search(self.IP_WAIT_PATTERN, self.html) wait_time = (int(found.group(1)) * 60 + int(found.group(2))) if found else 5 * 60 - self.setWait(wait_time, True) - self.wait() + self.wait(wait_time, True) self.retry() diff --git a/pyload/plugins/hoster/UploadingCom.py b/pyload/plugins/hoster/UploadingCom.py index 230c67490..9bb526506 100644 --- a/pyload/plugins/hoster/UploadingCom.py +++ b/pyload/plugins/hoster/UploadingCom.py @@ -83,8 +83,7 @@ class UploadingCom(SimpleHoster): if 'answer' in response and 'wait_time' in response['answer']: wait_time = int(response['answer']['wait_time']) self.logInfo("%s: Waiting %d seconds." % (self.__name__, wait_time)) - self.setWait(wait_time) - self.wait() + self.wait(wait_time) else: self.pluginParseError("AJAX/WAIT") @@ -107,8 +106,7 @@ class UploadingCom(SimpleHoster): check = self.checkDownload({"html": re.compile("\A<!DOCTYPE html PUBLIC")}) if check == "html": self.logWarning("Redirected to a HTML page, wait 10 minutes and retry") - self.setWait(600, True) - self.wait() + self.wait(10 * 60, True) getInfo = create_getInfo(UploadingCom) diff --git a/pyload/plugins/hoster/XFileSharingPro.py b/pyload/plugins/hoster/XFileSharingPro.py index ce190f2fe..3859d954e 100644 --- a/pyload/plugins/hoster/XFileSharingPro.py +++ b/pyload/plugins/hoster/XFileSharingPro.py @@ -215,15 +215,13 @@ class XFileSharingPro(SimpleHoster): if 'wait' in self.errmsg: wait_time = sum([int(v) * {"hour": 3600, "minute": 60, "second": 1}[u] for v, u in re.findall(r'(\d+)\s*(hour|minute|second)?', self.errmsg)]) - self.setWait(wait_time, True) - self.wait() + self.wait(wait_time, True) elif 'captcha' in self.errmsg: self.invalidCaptcha() elif 'premium' in self.errmsg and 'require' in self.errmsg: self.fail("File can be downloaded by premium users only") elif 'limit' in self.errmsg: - self.setWait(3600, True) - self.wait() + self.wait(1 * 60 * 60, True) self.retry(25) elif 'countdown' in self.errmsg or 'Expired' in self.errmsg: self.retry() |