summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-28 16:04:10 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-28 16:04:10 +0100
commit8b3589dd394d81177bf4680dddb5bdb9506b89ea (patch)
treef9e4b92955fe2577ef25e7bf07911bda3b5d7590
parent[SimpleHoster] Improve wait method (diff)
downloadpyload-8b3589dd394d81177bf4680dddb5bdb9506b89ea.tar.xz
Update plugins to last changes
-rw-r--r--module/plugins/crypter/ShareLinksBiz.py8
-rw-r--r--module/plugins/hooks/Checksum.py2
-rw-r--r--module/plugins/hoster/BayfilesCom.py3
-rw-r--r--module/plugins/hoster/BezvadataCz.py2
-rw-r--r--module/plugins/hoster/DateiTo.py5
-rw-r--r--module/plugins/hoster/DepositfilesCom.py3
-rw-r--r--module/plugins/hoster/FastshareCz.py4
-rw-r--r--module/plugins/hoster/FileSharkPl.py6
-rw-r--r--module/plugins/hoster/FilefactoryCom.py2
-rw-r--r--module/plugins/hoster/FreakshareCom.py4
-rw-r--r--module/plugins/hoster/Keep2shareCC.py4
-rw-r--r--module/plugins/hoster/LetitbitNet.py2
-rw-r--r--module/plugins/hoster/LuckyShareNet.py6
-rw-r--r--module/plugins/hoster/NetloadIn.py3
-rw-r--r--module/plugins/hoster/OboomCom.py4
-rw-r--r--module/plugins/hoster/OneFichierCom.py2
-rw-r--r--module/plugins/hoster/OverLoadMe.py2
-rw-r--r--module/plugins/hoster/RapidgatorNet.py2
-rw-r--r--module/plugins/hoster/RapidshareCom.py3
-rw-r--r--module/plugins/hoster/SimplyPremiumCom.py2
-rw-r--r--module/plugins/hoster/StreamcloudEu.py2
-rw-r--r--module/plugins/hoster/UpleaCom.py4
-rw-r--r--module/plugins/hoster/UploadedTo.py2
-rw-r--r--module/plugins/hoster/UploadingCom.py2
-rw-r--r--module/plugins/internal/XFSPHoster.py6
25 files changed, 38 insertions, 47 deletions
diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py
index f45aa4570..7c4d769c6 100644
--- a/module/plugins/crypter/ShareLinksBiz.py
+++ b/module/plugins/crypter/ShareLinksBiz.py
@@ -124,9 +124,7 @@ class ShareLinksBiz(Crypter):
href = self._resolveCoords(coords, captchaMap)
if href is None:
self.invalidCaptcha()
- self.setWait(5, False)
- self.wait()
- self.retry()
+ self.retry(wait_time=5)
url = self.baseUrl + href
self.html = self.load(url, decode=True)
@@ -156,9 +154,7 @@ class ShareLinksBiz(Crypter):
if self.captcha:
if "Your choice was wrong" in self.html:
self.invalidCaptcha()
- self.setWait(5)
- self.wait()
- self.retry()
+ self.retry(wait_time=5)
else:
self.correctCaptcha()
diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py
index af9ff22a9..b19700206 100644
--- a/module/plugins/hooks/Checksum.py
+++ b/module/plugins/hooks/Checksum.py
@@ -140,7 +140,7 @@ class Checksum(Hook):
if pyfile.plugin.retries < max_tries:
if local_file:
remove(local_file)
- pyfile.plugin.retry(max_tries=max_tries, wait_time=self.getConfig("wait_time"), reason=msg)
+ pyfile.plugin.retry(max_tries, self.getConfig("wait_time"), msg)
elif retry_action == "nothing":
return
elif check_action == "nothing":
diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py
index 48758ed88..c438511a9 100644
--- a/module/plugins/hoster/BayfilesCom.py
+++ b/module/plugins/hoster/BayfilesCom.py
@@ -33,8 +33,7 @@ class BayfilesCom(SimpleHoster):
def handleFree(self):
m = re.search(self.WAIT_PATTERN, self.html)
if m:
- self.wait(int(m.group(1)) * 60)
- self.retry()
+ self.retry(wait_time=int(m.group(1)) * 60)
# Get download token
m = re.search(self.VARS_PATTERN, self.html)
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py
index 2b1959674..b861ee104 100644
--- a/module/plugins/hoster/BezvadataCz.py
+++ b/module/plugins/hoster/BezvadataCz.py
@@ -71,7 +71,7 @@ class BezvadataCz(SimpleHoster):
#countdown
m = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html)
- wait_time = (int(m.group(1)) * 60 + int(m.group(2)) + 1) if m else 120
+ wait_time = (int(m.group(1)) * 60 + int(m.group(2))) if m else 120
self.wait(wait_time, False)
self.download(url)
diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py
index 4eed41496..821be580f 100644
--- a/module/plugins/hoster/DateiTo.py
+++ b/module/plugins/hoster/DateiTo.py
@@ -64,8 +64,7 @@ class DateiTo(SimpleHoster):
if m:
m = re.search(self.WAIT_PATTERN, self.html)
wait_time = int(m.group(1)) if m else 30
- self.wait(wait_time + 1, False)
- self.retry()
+ self.retry(wait_time=wait_time)
def doWait(self):
@@ -73,7 +72,7 @@ class DateiTo(SimpleHoster):
wait_time = int(m.group(1)) if m else 30
self.load('http://datei.to/ajax/download.php', post={'P': 'Ads'})
- self.wait(wait_time + 1, False)
+ self.wait(wait_time, False)
getInfo = create_getInfo(DateiTo)
diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py
index de1cb7000..07b5736f6 100644
--- a/module/plugins/hoster/DepositfilesCom.py
+++ b/module/plugins/hoster/DepositfilesCom.py
@@ -42,8 +42,7 @@ class DepositfilesCom(SimpleHoster):
if re.search(r'File is checked, please try again in a minute.', self.html) is not None:
self.logInfo(_("The file is being checked. Waiting 1 minute"))
- self.wait(61)
- self.retry()
+ self.retry(wait_time=60)
wait = re.search(r'html_download_api-limit_interval\">(\d+)</span>', self.html)
if wait:
diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py
index f15d95ad5..40a322c0f 100644
--- a/module/plugins/hoster/FastshareCz.py
+++ b/module/plugins/hoster/FastshareCz.py
@@ -38,7 +38,7 @@ class FastshareCz(SimpleHoster):
def handleFree(self):
if "> 100% of FREE slots are full" in self.html:
- self.retry(120, 60, "No free slots")
+ self.retry(12, 60, _("No free slots"))
m = re.search(self.FREE_URL_PATTERN, self.html)
if m:
@@ -56,7 +56,7 @@ class FastshareCz(SimpleHoster):
})
if check == "paralell_dl":
- self.retry(6, 10 * 60, "Paralell download")
+ self.retry(6, 10 * 60, _("Paralell download"))
elif check == "wrong_captcha":
self.retry(max_tries=5, reason=_("Wrong captcha"))
diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py
index 4cb816724..f70fdb5ac 100644
--- a/module/plugins/hoster/FileSharkPl.py
+++ b/module/plugins/hoster/FileSharkPl.py
@@ -60,10 +60,10 @@ class FileSharkPl(SimpleHoster):
self.fail(_("Only connections from Polish IP are allowed"))
elif re.match(self.DOWNLOAD_SLOTS_ERROR_PATTERN, alert):
self.logInfo(_("No free download slots available"))
- self.retry(10, 30 * 60, "Still no free download slots available")
+ self.retry(10, 30 * 60, _("Still no free download slots available"))
else:
self.logInfo(alert)
- self.retry(10, 10 * 60, "Try again later")
+ self.retry(10, 10 * 60, _("Try again later"))
#@NOTE: handlePremium method was never been tested
@@ -124,7 +124,7 @@ class FileSharkPl(SimpleHoster):
elif check == "wrong_captcha":
self.invalidCaptcha()
- self.retry(10, 1, reason=_("Wrong captcha solution"))
+ self.retry(10, 1, _("Wrong captcha solution"))
elif check == "wait_pattern":
self.retry()
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py
index c2d18160a..f35108cff 100644
--- a/module/plugins/hoster/FilefactoryCom.py
+++ b/module/plugins/hoster/FilefactoryCom.py
@@ -47,7 +47,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, 15 * 60, "All free slots are busy")
+ self.retry(50, 15 * 60, _("All free slots are busy"))
m = re.search(self.LINK_PATTERN, self.html)
if m is None:
diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py
index 35c7aa253..5d69f0a1b 100644
--- a/module/plugins/hoster/FreakshareCom.py
+++ b/module/plugins/hoster/FreakshareCom.py
@@ -61,7 +61,7 @@ class FreakshareCom(Hoster):
self.invalidCaptcha()
self.retry()
elif check == "downloadserver":
- self.retry(5, 15 * 60, "No Download server")
+ self.retry(5, 15 * 60, _("No Download server"))
def prepare(self):
@@ -141,7 +141,7 @@ class FreakshareCom(Hoster):
timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[\d.]*;', self.html)
if timestring:
- return int(timestring.group(1)) + 1 # add 1 sec as tenths of seconds are cut off
+ return int(timestring.group(1))
else:
return 60
diff --git a/module/plugins/hoster/Keep2shareCC.py b/module/plugins/hoster/Keep2shareCC.py
index bd7825d08..36b5bfad3 100644
--- a/module/plugins/hoster/Keep2shareCC.py
+++ b/module/plugins/hoster/Keep2shareCC.py
@@ -54,14 +54,14 @@ class Keep2shareCC(SimpleHoster):
# string to time convert courtesy of https://stackoverflow.com/questions/10663720
ftr = [3600, 60, 1]
wait_time = sum([a * b for a, b in zip(ftr, map(int, m.group(1).split(':')))])
- self.wait(wait_time, reconnect=True)
+ self.wait(wait_time, True)
self.retry()
m = re.search(self.MULTIDL_ERROR, self.html)
if m:
# if someone is already downloading on our line, wait 30min and retry
self.logDebug("Already downloading, waiting for 30 minutes")
- self.wait(30 * 60, reconnect=True)
+ self.wait(30 * 60, True)
self.retry()
m = re.search(self.LINK_PATTERN, self.html)
diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py
index 94702e4ab..8a5765a8c 100644
--- a/module/plugins/hoster/LetitbitNet.py
+++ b/module/plugins/hoster/LetitbitNet.py
@@ -86,7 +86,7 @@ class LetitbitNet(SimpleHoster):
m = re.search(self.CAPTCHA_CONTROL_FIELD, self.html)
recaptcha_control_field = m.group(1)
self.logDebug("ReCaptcha control field found", recaptcha_control_field)
- self.wait(seconds + 1)
+ self.wait(seconds)
response = self.load("%s/ajax/download3.php" % domain, post=" ", cookies=True)
if response != '1':
diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py
index 4917bebfb..94f14481d 100644
--- a/module/plugins/hoster/LuckyShareNet.py
+++ b/module/plugins/hoster/LuckyShareNet.py
@@ -29,9 +29,9 @@ class LuckyShareNet(SimpleHoster):
html = self.load(self.pyfile.url, decode=True)
m = re.search(r"waitingtime = (\d+);", html)
if m:
- waittime = int(m.group(1))
- self.logDebug("You have to wait %d seconds between free downloads" % waittime)
- self.retry(wait_time=waittime)
+ seconds = int(m.group(1))
+ self.logDebug("You have to wait %d seconds between free downloads" % seconds)
+ self.retry(wait_time=seconds)
else:
self.error(_("Unable to detect wait time between free downloads"))
elif 'Hash expired' in rep:
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index 2f0c6e2a8..d4980ceca 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -191,8 +191,7 @@ class NetloadIn(Hoster):
self.logDebug("Wait was 0 setting 30")
wait = 30 * 60
self.logInfo(_("Waiting between downloads %d seconds") % wait)
- self.wantReconnect = True
- self.setWait(wait)
+ self.setWait(wait, True)
self.wait()
return self.download_html()
diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py
index 345d130c1..569c8e383 100644
--- a/module/plugins/hoster/OboomCom.py
+++ b/module/plugins/hoster/OboomCom.py
@@ -96,13 +96,13 @@ class OboomCom(Hoster):
elif result[1] == "captcha-timeout":
self.invalidCaptcha()
elif result[1] == "forbidden":
- self.retry(5, 15 * 60, "Service unavailable")
+ self.retry(5, 15 * 60, _("Service unavailable"))
elif result[0] == 403:
if result[1] == -1: # another download is running
self.setWait(15 * 60)
else:
- self.setWait(result[1], reconnect=True)
+ self.setWait(result[1], True)
self.wait()
self.retry(5)
else:
diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py
index d7e477356..b40c45a95 100644
--- a/module/plugins/hoster/OneFichierCom.py
+++ b/module/plugins/hoster/OneFichierCom.py
@@ -39,7 +39,7 @@ class OneFichierCom(SimpleHoster):
def handleFree(self):
m = re.search(self.WAIT_PATTERN, self.html)
if m:
- wait_time = int(m.group(1)) + 1 #: One minute more than what the page displays to be safe
+ wait_time = int(m.group(1))
self.logInfo(_("You have to wait been each free download"), _("Retrying in %d minutes") % wait_time)
self.wait(wait_time * 60, True)
self.retry()
diff --git a/module/plugins/hoster/OverLoadMe.py b/module/plugins/hoster/OverLoadMe.py
index 436e3b65a..d099a9d4e 100644
--- a/module/plugins/hoster/OverLoadMe.py
+++ b/module/plugins/hoster/OverLoadMe.py
@@ -81,4 +81,4 @@ class OverLoadMe(Hoster):
if check == "error":
# usual this download can safely be retried
- self.retry(reason=_("An error occured while generating link."), wait_time=60)
+ self.retry(wait_time=60, reason=_("An error occured while generating link."))
diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py
index 591537ae4..6e8b5ebeb 100644
--- a/module/plugins/hoster/RapidgatorNet.py
+++ b/module/plugins/hoster/RapidgatorNet.py
@@ -104,7 +104,7 @@ class RapidgatorNet(SimpleHoster):
jsvars.get('startTimerUrl', '/download/AjaxStartTimer'), jsvars['fid'])
jsvars.update(self.getJsonResponse(url))
- self.wait(int(jsvars.get('secs', 45)) + 1, False)
+ self.wait(int(jsvars.get('secs', 45)), False)
url = "http://rapidgator.net%s?sid=%s" % (
jsvars.get('getDownloadUrl', '/download/AjaxGetDownload'), jsvars['sid'])
diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py
index 1b8967108..24e39f8f8 100644
--- a/module/plugins/hoster/RapidshareCom.py
+++ b/module/plugins/hoster/RapidshareCom.py
@@ -205,8 +205,7 @@ class RapidshareCom(Hoster):
elif "Filename invalid." in result:
self.fail(_("Filename reported invalid"))
elif between_wait:
- self.setWait(int(between_wait.group(1)))
- self.wantReconnect = True
+ self.setWait(int(between_wait.group(1)), True)
self.wait()
else:
self.no_download = False
diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py
index f236fb01c..fbc7939e5 100644
--- a/module/plugins/hoster/SimplyPremiumCom.py
+++ b/module/plugins/hoster/SimplyPremiumCom.py
@@ -53,7 +53,7 @@ class SimplyPremiumCom(Hoster):
self.retry(5, 60, "Reached maximum connctions")
elif "trafficlimit" in page:
self.logWarning(_("Reached daily limit for this host"))
- self.retry(1, secondsToMidnight(gmt=2), "Daily limit for this host reached")
+ self.retry(wait_time=secondsToMidnight(gmt=2), "Daily limit for this host reached")
elif "hostererror" in page:
self.logWarning(_("Hoster temporarily unavailable, waiting 1 minute and retry"))
self.retry(5, 60, "Hoster is temporarily unavailable")
diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py
index 24b0ebfae..ec006aeb2 100644
--- a/module/plugins/hoster/StreamcloudEu.py
+++ b/module/plugins/hoster/StreamcloudEu.py
@@ -92,7 +92,7 @@ class StreamcloudEu(XFSPHoster):
if not self.premium:
m = re.search(self.WAIT_PATTERN, self.html)
if m:
- wait_time = int(m.group(1)) + 1
+ wait_time = int(m.group(1))
self.setWait(wait_time, False)
else:
wait_time = 0
diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py
index 877bcc217..5ca9f2e40 100644
--- a/module/plugins/hoster/UpleaCom.py
+++ b/module/plugins/hoster/UpleaCom.py
@@ -42,8 +42,8 @@ class UpleaCom(XFSPHoster):
m = re.search(self.WAIT_PATTERN, self.html)
if m:
- self.wantReconnect = True
- self.retry(1, m.group(1))
+ self.wait(m.group(1), True)
+ self.retry()
m = re.search(self.LINK_PATTERN, self.html)
if m is None:
diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py
index 8a4af51b4..44eaa4c76 100644
--- a/module/plugins/hoster/UploadedTo.py
+++ b/module/plugins/hoster/UploadedTo.py
@@ -191,7 +191,7 @@ class UploadedTo(Hoster):
if 'var free_enabled = false;' in self.html:
self.logError(_("Free-download capacities exhausted"))
- self.retry(max_tries=24, wait_time=5 * 60)
+ self.retry(24, 5 * 60)
m = re.search(r"Current waiting period: <span>(\d+)</span> seconds", self.html)
if m is None:
diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py
index 656543a83..6a435fb5a 100644
--- a/module/plugins/hoster/UploadingCom.py
+++ b/module/plugins/hoster/UploadingCom.py
@@ -64,7 +64,7 @@ class UploadingCom(SimpleHoster):
if m:
self.pyfile.error = m.group(1)
self.logWarning(self.pyfile.error)
- self.retry(max_tries=6, wait_time=6 * 60 * 60 if m.group(2) else 15 * 60, reason=self.pyfile.error)
+ self.retry(6, (6 * 60 if m.group(2) else 15) * 60, self.pyfile.error)
ajax_url = "http://uploading.com/files/get/?ajax"
self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
diff --git a/module/plugins/internal/XFSPHoster.py b/module/plugins/internal/XFSPHoster.py
index 5452b9444..9e14fffbc 100644
--- a/module/plugins/internal/XFSPHoster.py
+++ b/module/plugins/internal/XFSPHoster.py
@@ -229,8 +229,8 @@ class XFSPHoster(SimpleHoster):
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.wantReconnect = True
- self.retry(25, 1 * 60 * 60, "Download limit exceeded")
+ self.wait(1 * 60 * 60, True)
+ self.retry(25, reason="Download limit exceeded")
elif 'countdown' in self.errmsg or 'Expired' in self.errmsg:
self.retry(reason=_("Link expired"))
elif 'maintenance' in self.errmsg or 'maintainance' in self.errmsg:
@@ -275,7 +275,7 @@ class XFSPHoster(SimpleHoster):
if not self.premium:
m = re.search(self.WAIT_PATTERN, self.html)
if m:
- wait_time = int(m.group(1)) + 1
+ wait_time = int(m.group(1))
self.setWait(wait_time, False)
else:
wait_time = 0