summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/hooks/ExtractArchive.py8
-rw-r--r--module/plugins/internal/UnRar.py9
2 files changed, 9 insertions, 8 deletions
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 47325608d..e1c05878c 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.24"
+ __version__ = "1.25"
__config__ = [("activated" , "bool" , "Activated" , True ),
("fullpath" , "bool" , "Extract with full paths" , True ),
@@ -312,7 +312,7 @@ class ExtractArchive(Hook):
self.setPermissions(new_files)
for filename in new_files:
- file = fs_encode(filename)
+ file = fs_encode(save_join(filename, os.path.dirname(archive.filename)))
if not os.path.exists(file):
self.logDebug("New file %s does not exists" % filename)
continue
@@ -390,7 +390,7 @@ class ExtractArchive(Hook):
if not encrypted or not self.getConfig("usepasswordfile"):
archive.extract(password)
else:
- for pw in set(self.getPasswords(False) + [password]):
+ for pw in uniqify([password] + self.getPasswords(False)):
try:
self.logDebug("Try password: %s" % pw)
@@ -465,7 +465,7 @@ class ExtractArchive(Hook):
file = fs_encode(self.getConfig("passwordfile"))
with open(file) as f:
- for pw in f.read().splitlines()[:-1]:
+ for pw in f.read().splitlines():
passwords.append(pw)
except IOError, e:
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index c1cc0fa31..7126c960b 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.09"
+ __version__ = "1.10"
__description__ = """Rar extractor plugin"""
__license__ = "GPLv3"
@@ -32,7 +32,8 @@ class UnRar(Extractor):
CMD = "unrar"
- EXTENSIONS = [".rar", ".zip", ".cab", ".arj", ".lzh", ".tar", ".gz", ".bz2",
+ # TODO: Find out what Filetypes Unrar supports exactly
+ EXTENSIONS = [".rar", ".cab", ".arj", ".lzh", ".tar", ".gz", ".bz2",
".ace", ".uue", ".jar", ".iso", ".7z", ".xz", ".z"]
#@NOTE: there are some more uncovered rar formats
@@ -40,7 +41,7 @@ class UnRar(Extractor):
re_rarpart2 = re.compile(r'\.r(\d+)$', re.I)
re_filefixed = re.compile(r'Building (.+)')
- re_filelist = re.compile(r'(.+)\s+(\d+)\s+(\d+)\s+|(.+)\s+(\d+)\s+\d\d-\d\d-\d\d\s+\d\d:\d\d\s+(.+)')
+ re_filelist = re.compile(r'(.+)\s+(\D+)\s+(\d+)\s+\d\d-\d\d-\d\d\s+\d\d:\d\d\s+(.+)')
re_wrongpwd = re.compile(r'password', re.I)
re_wrongcrc = re.compile(r'encrypted|damaged|CRC failed|checksum error', re.I)
@@ -220,7 +221,7 @@ class UnRar(Extractor):
# 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-")