diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-29 08:21:04 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-29 08:21:04 +0200 |
commit | 5a2781c923ecd13f3e671366fa6fa311d92d8547 (patch) | |
tree | f65fe11c0ea7e2122bb91ef7efd45ab71320353b /module/plugins/internal/UnRar.py | |
parent | Fix https://github.com/pyload/pyload/issues/1587 (diff) | |
download | pyload-5a2781c923ecd13f3e671366fa6fa311d92d8547.tar.xz |
Fix https://github.com/pyload/pyload/issues/1586
Diffstat (limited to 'module/plugins/internal/UnRar.py')
-rw-r--r-- | module/plugins/internal/UnRar.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index 30b763922..92128c77f 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.23" + __version__ = "1.24" __status__ = "testing" __description__ = """Rar extractor plugin""" @@ -32,11 +32,9 @@ class UnRar(Extractor): ("Immenz" , "immenz@gmx.net" )] - CMD = "unrar" - VERSION = "" + CMD = "unrar" EXTENSIONS = [".rar"] - re_multipart = re.compile(r'\.(part|r)(\d+)(?:\.rar)?(\.rev|\.bad)?', re.I) re_filefixed = re.compile(r'Building (.+)') @@ -58,7 +56,7 @@ class UnRar(Extractor): p = subprocess.Popen([cls.CMD], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() - cls.__name__ = "RAR" + # cls.__name__ = "RAR" cls.REPAIR = True except OSError: @@ -74,12 +72,11 @@ class UnRar(Extractor): except OSError: return False - else: - return True + m = cls.re_version.search(out) + if m is not None: + cls.VERSION = m.group(1) - finally: - m = cls.re_version.search(out) - cls.VERSION = m.group(1) if m else '(version unknown)' + return True @classmethod @@ -206,8 +203,7 @@ class UnRar(Extractor): result.add(fs_join(self.out, os.path.basename(f))) else: for f in fs_decode(out).splitlines(): - f = f.strip() - result.add(fs_join(self.out, f)) + result.add(fs_join(self.out, f.strip())) return list(result) |