diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/ReCaptcha.py | 4 | ||||
-rw-r--r-- | module/plugins/hooks/UnRar.py | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/module/plugins/ReCaptcha.py b/module/plugins/ReCaptcha.py index 23e1064ce..d29530a64 100644 --- a/module/plugins/ReCaptcha.py +++ b/module/plugins/ReCaptcha.py @@ -6,9 +6,7 @@ class ReCaptcha(): def challenge(self, id): js = self.plugin.req.load("http://api.recaptcha.net/challenge", get={"k":id}, cookies=True) - print js - challenge = re.search("challenge : '(.*?)',", js).group(1) - server = re.search("server : '(.*?)',", js).group(1) + try: challenge = re.search("challenge : '(.*?)',", js).group(1) server = re.search("server : '(.*?)',", js).group(1) diff --git a/module/plugins/hooks/UnRar.py b/module/plugins/hooks/UnRar.py index 38a5a55e8..f6c202ddb 100644 --- a/module/plugins/hooks/UnRar.py +++ b/module/plugins/hooks/UnRar.py @@ -20,7 +20,7 @@ from __future__ import with_statement from module.plugins.Hook import Hook -from module.pyunrar import Unrar, WrongPasswordError, CommandError +from module.pyunrar import Unrar, WrongPasswordError, CommandError, UnknownError from os.path import exists, join from os import remove @@ -106,10 +106,10 @@ class UnRar(Hook): u = Unrar(join(folder, fname)) try: - u.crackPassword(passwords=self.passwords, statusFunction=s, overwrite=True, destination=folder) + success = u.crackPassword(passwords=self.passwords, statusFunction=s, overwrite=True, destination=folder) except WrongPasswordError: continue - except CommandError , e: + except CommandError, e: if re.search("Cannot find volume", e.stderr): continue try: @@ -117,8 +117,11 @@ class UnRar(Hook): self.removeFiles(pack, fname) except: continue + except UnknownError: + continue else: - self.removeFiles(pack, fname) + if success: + self.removeFiles(pack, fname) finally: pyfile.alternativePercent = None pyfile.setStatus("finished") |