summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-01 04:59:34 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-01 04:59:34 +0200
commit21be6c5990af016d5ef4298ece52bf434d11f306 (patch)
tree4884b662bc0af03698b89e694686e634e2d38b7e /module
parentA lot of plugin code cosmetics (diff)
downloadpyload-21be6c5990af016d5ef4298ece52bf434d11f306.tar.xz
A lot of plugin code cosmetics (2)
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hooks/UpdateManager.py2
-rw-r--r--module/plugins/internal/Account.py2
-rw-r--r--module/plugins/internal/Captcha.py3
-rw-r--r--module/plugins/internal/XFSAccount.py4
-rw-r--r--module/plugins/internal/XFSHoster.py12
5 files changed, 11 insertions, 12 deletions
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py
index 3a97836f1..312355675 100644
--- a/module/plugins/hooks/UpdateManager.py
+++ b/module/plugins/hooks/UpdateManager.py
@@ -79,7 +79,7 @@ class UpdateManager(Addon):
if self.get_config('nodebugupdate'):
return
- if self.get_config('checkperiod')and \
+ if self.get_config('checkperiod') and \
time.time() - max(self.MIN_CHECK_INTERVAL, self.get_config('checkinterval') * 60 * 60) > self.info['last_check']:
self.update()
diff --git a/module/plugins/internal/Account.py b/module/plugins/internal/Account.py
index 7060959ee..123241be3 100644
--- a/module/plugins/internal/Account.py
+++ b/module/plugins/internal/Account.py
@@ -331,7 +331,7 @@ class Account(Plugin):
continue
except Exception:
- self.log_warning(_("Wrong time format `%s` for account `%s`, use 1:22-3:44")
+ self.log_warning(_("Invalid time format `%s` for account `%s`, use 1:22-3:44")
% (user, time_data))
if data['trafficleft'] == 0:
diff --git a/module/plugins/internal/Captcha.py b/module/plugins/internal/Captcha.py
index 3d105ed12..a8f48b5e4 100644
--- a/module/plugins/internal/Captcha.py
+++ b/module/plugins/internal/Captcha.py
@@ -104,8 +104,7 @@ class Captcha(Plugin):
self.fail(self.task.error)
elif not self.task.result:
- self.invalid()
- self.plugin.retry(msg=_("No captcha result obtained in appropiate time"))
+ self.plugin.retry_captcha(msg=_("No captcha result obtained in appropriate time"))
result = self.task.result
diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py
index 91136a2a0..3b92a191b 100644
--- a/module/plugins/internal/XFSAccount.py
+++ b/module/plugins/internal/XFSAccount.py
@@ -61,7 +61,7 @@ class XFSAccount(Account):
premium = True if re.search(self.PREMIUM_PATTERN, html) else False
m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
+ if m is not None:
expiredate = m.group(1).strip()
self.log_debug("Expire date: " + expiredate)
@@ -84,7 +84,7 @@ class XFSAccount(Account):
self.log_debug("VALID_UNTIL_PATTERN not found")
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if m:
+ if m is not None:
try:
traffic = m.groupdict()
size = traffic['S']
diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py
index 8af6b83ed..98ed4e016 100644
--- a/module/plugins/internal/XFSHoster.py
+++ b/module/plugins/internal/XFSHoster.py
@@ -95,7 +95,7 @@ class XFSHoster(SimpleHoster):
self.check_errors()
m = re.search(self.LINK_PATTERN, self.html, re.S)
- if m:
+ if m is not None:
break
data = self.get_post_parameters()
@@ -111,7 +111,7 @@ class XFSHoster(SimpleHoster):
break
m = re.search(self.LINK_PATTERN, self.html, re.S)
- if m:
+ if m is not None:
break
else:
if 'op' in data:
@@ -163,7 +163,7 @@ class XFSHoster(SimpleHoster):
self.retry(20, 3 * 60, _("Can not leech file"))
elif 'today' in stmsg:
- self.retry(delay=seconds_to_midnight(), msg=_("You've used all Leech traffic today"))
+ self.retry(wait=seconds_to_midnight(), msg=_("You've used all Leech traffic today"))
else:
self.fail(stmsg)
@@ -202,7 +202,7 @@ class XFSHoster(SimpleHoster):
if not self.premium:
m = re.search(self.WAIT_PATTERN, self.html)
- if m:
+ if m is not None:
wait_time = int(m.group(1))
self.set_wait(wait_time, False)
@@ -223,13 +223,13 @@ class XFSHoster(SimpleHoster):
def handle_captcha(self, inputs):
m = re.search(self.CAPTCHA_PATTERN, self.html)
- if m:
+ if m is not None:
captcha_url = m.group(1)
inputs['code'] = self.captcha.decrypt(captcha_url)
return
m = re.search(self.CAPTCHA_BLOCK_PATTERN, self.html, re.S)
- if m:
+ if m is not None:
captcha_div = m.group(1)
numerals = re.findall(r'<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>', html_unescape(captcha_div))