diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-03 01:10:04 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-03 01:10:04 +0100 |
commit | 8d8cfd57fa44cb84eb9709871bf14a3b4d13d994 (patch) | |
tree | a136d466d3aa6e8a80da3a26f3864bd2e544fe7b /module/plugins | |
parent | [MegaCoNzFolder] Fixup (diff) | |
download | pyload-8d8cfd57fa44cb84eb9709871bf14a3b4d13d994.tar.xz |
Update Extractor (4)
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hooks/ExtractArchive.py | 9 | ||||
-rw-r--r-- | module/plugins/internal/SevenZip.py | 4 | ||||
-rw-r--r-- | module/plugins/internal/UnRar.py | 6 | ||||
-rw-r--r-- | module/plugins/internal/UnZip.py | 6 |
4 files changed, 14 insertions, 11 deletions
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 74dded9b7..47325608d 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -103,7 +103,7 @@ class ArchiveQueue(object): class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.23" + __version__ = "1.24" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract with full paths" , True ), @@ -205,6 +205,9 @@ class ExtractArchive(Hook): def extract(self, ids): + if not ids: + return False + self.extracting = True processed = [] @@ -226,7 +229,7 @@ class ExtractArchive(Hook): excludefiles = toList(self.getConfig("excludefiles")) if extensions: - self.logDebug("Extensions: %s" % "|.".join(extensions)) + self.logDebug("Use for extensions: %s" % "|.".join(extensions)) # reload from txt file self.reloadPasswords() @@ -462,7 +465,7 @@ class ExtractArchive(Hook): file = fs_encode(self.getConfig("passwordfile")) with open(file) as f: - for pw in f.read().splitlines(): + for pw in f.read().splitlines()[:-1]: passwords.append(pw) except IOError, e: diff --git a/module/plugins/internal/SevenZip.py b/module/plugins/internal/SevenZip.py index 2f4dc5565..96e664573 100644 --- a/module/plugins/internal/SevenZip.py +++ b/module/plugins/internal/SevenZip.py @@ -11,7 +11,7 @@ from module.utils import fs_encode, save_join class SevenZip(UnRar): __name__ = "SevenZip" - __version__ = "0.06" + __version__ = "0.07" __description__ = """7-Zip extractor plugin""" __license__ = "GPLv3" @@ -138,7 +138,7 @@ class SevenZip(UnRar): #set a password if "password" in kwargs and kwargs["password"]: - args.append("-p%s" % kwargs["password"]) + args.append("-p'%s'" % kwargs["password"]) else: args.append("-p-") diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index d378bf167..c1cc0fa31 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.08" + __version__ = "1.09" __description__ = """Rar extractor plugin""" __license__ = "GPLv3" @@ -213,14 +213,14 @@ class UnRar(Extractor): args.append("-or") for word in self.excludefiles: - args.append("-x%s" % word.strip()) + args.append("-x'%s'" % word.strip()) # assume yes on all queries args.append("-y") # set a password if "password" in kwargs and kwargs['password']: - args.append("-p%s" % kwargs['password']) + args.append("-p'%s'" % kwargs['password']) else: args.append("-p-") diff --git a/module/plugins/internal/UnZip.py b/module/plugins/internal/UnZip.py index 781c47d7b..f81c235c1 100644 --- a/module/plugins/internal/UnZip.py +++ b/module/plugins/internal/UnZip.py @@ -50,10 +50,10 @@ class UnZip(Extractor): badfile = z.testzip() - if not badfile: - z.extractall(self.out) - else: + if badfile: raise CRCError(badfile) + else: + z.extractall(self.out) except (zipfile.BadZipfile, zipfile.LargeZipFile), e: raise ArchiveError(e) |