summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/SevenZip.py2
-rw-r--r--module/plugins/internal/SimpleHoster.py4
-rw-r--r--module/plugins/internal/UnRar.py12
-rw-r--r--module/plugins/internal/XFSHoster.py13
4 files changed, 19 insertions, 12 deletions
diff --git a/module/plugins/internal/SevenZip.py b/module/plugins/internal/SevenZip.py
index 05be90702..476348083 100644
--- a/module/plugins/internal/SevenZip.py
+++ b/module/plugins/internal/SevenZip.py
@@ -166,7 +166,7 @@ class SevenZip(UnRar):
#@NOTE: return codes are not reliable, some kind of threading, cleanup whatever issue
call = [self.cmd, command] + args + list(xargs)
- self.manager.logDebug(" ".join([decode(arg) for arg in call]))
+ self.manager.logDebug(" ".join(map(decode, call)))
p = Popen(call, stdout=PIPE, stderr=PIPE)
return p
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index c74e33d59..da178ef9c 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -547,8 +547,8 @@ class SimpleHoster(Hoster):
elif hasattr(self, 'WAIT_PATTERN'):
m = re.search(self.WAIT_PATTERN, self.html)
if m:
- 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)])
+ 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
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index 0738aa63b..f92a2ddd4 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -22,7 +22,7 @@ def renice(pid, value):
class UnRar(Extractor):
__name__ = "UnRar"
- __version__ = "1.05"
+ __version__ = "1.06"
__description__ = """Rar extractor plugin"""
__license__ = "GPLv3"
@@ -45,7 +45,7 @@ class UnRar(Extractor):
@classmethod
- def checkDeps(cls):
+ def isUsable(cls):
if os.name == "nt":
cls.CMD = os.path.join(pypath, "UnRAR.exe")
p = Popen([cls.CMD], stdout=PIPE, stderr=PIPE)
@@ -67,13 +67,13 @@ class UnRar(Extractor):
def getTargets(cls, files_ids):
targets = []
- for filename, id in files_ids:
- if not cls.isArchive(filename):
+ for fname, id in files_ids:
+ if not cls.isArchive(fname):
continue
- m = cls.re_rarpart1.match(filename)
+ m = cls.re_rarpart1.match(fname)
if not m or int(m.group(1)) == 1: #@NOTE: only add first part file
- targets.append((filename, id))
+ targets.append((fname, id))
return targets
diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py
index 2054b1824..624534dbd 100644
--- a/module/plugins/internal/XFSHoster.py
+++ b/module/plugins/internal/XFSHoster.py
@@ -218,8 +218,8 @@ class XFSHoster(SimpleHoster):
self.logWarning(re.sub(r"<.*?>", " ", self.errmsg))
if 'wait' in self.errmsg:
- 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)', self.errmsg, re.I)])
+ 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)', self.errmsg, re.I))
self.wait(wait_time, True)
elif 'country' in self.errmsg:
@@ -318,16 +318,21 @@ class XFSHoster(SimpleHoster):
if m:
captcha_div = m.group(1)
numerals = re.findall(r'<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>', html_unescape(captcha_div))
+
self.logDebug(captcha_div)
- inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))])
+
+ inputs['code'] = "".join(a[1] for a in sorted(numerals, key=lambda num: int(num[0])))
+
self.logDebug("Captcha code: %s" % inputs['code'], numerals)
return 2
recaptcha = ReCaptcha(self)
try:
captcha_key = re.search(self.RECAPTCHA_PATTERN, self.html).group(1)
+
except Exception:
captcha_key = recaptcha.detect_key()
+
else:
self.logDebug("ReCaptcha key: %s" % captcha_key)
@@ -338,8 +343,10 @@ class XFSHoster(SimpleHoster):
solvemedia = SolveMedia(self)
try:
captcha_key = re.search(self.SOLVEMEDIA_PATTERN, self.html).group(1)
+
except Exception:
captcha_key = solvemedia.detect_key()
+
else:
self.logDebug("SolveMedia key: %s" % captcha_key)