summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/UnRar.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-16 23:04:15 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-16 23:04:15 +0100
commit8bb189cf5495b293cf574e5049c34a64ae36ffe1 (patch)
tree934b5a0a2cc798a19f3e5fdb9235b295ca638c16 /module/plugins/internal/UnRar.py
parent[SkipRev] Another fix (diff)
downloadpyload-8bb189cf5495b293cf574e5049c34a64ae36ffe1.tar.xz
Spare code cosmetics
Diffstat (limited to 'module/plugins/internal/UnRar.py')
-rw-r--r--module/plugins/internal/UnRar.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index c15a4c96e..716a62613 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -22,7 +22,7 @@ def renice(pid, value):
class UnRar(AbtractExtractor):
__name__ = "UnRar"
- __version__ = "0.19"
+ __version__ = "0.20"
__description__ = """Rar extractor plugin"""
__license__ = "GPLv3"
@@ -32,7 +32,7 @@ class UnRar(AbtractExtractor):
CMD = "unrar"
# there are some more uncovered rar formats
- re_version = re.compile(r'UNRAR ([\w .]+?) freeware')
+ re_version = re.compile(r'UNRAR ([\w .]+?)')
re_splitfile = re.compile(r'(.*)\.part(\d+)\.rar$', re.I)
re_partfiles = re.compile(r'.*\.(rar|r\d+)', re.I)
re_filelist = re.compile(r'(.+)\s+(\d+)\s+(\d+)\s+')
@@ -91,7 +91,7 @@ class UnRar(AbtractExtractor):
out, err = p.communicate()
if self.re_wrongpwd.search(err):
self.passwordProtected = True
- self.headerProtected = True
+ self.headerProtected = True
return True
# output only used to check if passworded files are present
@@ -124,7 +124,7 @@ class UnRar(AbtractExtractor):
return True
- def extract(self, progress, password=None):
+ def extract(self, progress, password=""):
command = "x" if self.fullpath else "e"
p = self.call_unrar(command, self.file, self.out, password=password)
@@ -156,6 +156,7 @@ class UnRar(AbtractExtractor):
raise CRCError
elif "CRC failed" in err:
raise WrongPassword
+
if err.strip(): #: raise error if anything is on stderr
raise ArchiveError(err.strip())
if p.returncode: