summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Ben White <bepix@users.noreply.github.com> 2014-03-29 22:44:45 +0100
committerGravatar Stefano <l.stickell@yahoo.it> 2014-04-21 17:12:07 +0200
commit2e4aaa2258635a3366d5b1dc34a0ea81a1935136 (patch)
treedd5826c31a628019af0acad5adee14d28aee6481
parentYoutube: fixed #498 (diff)
downloadpyload-2e4aaa2258635a3366d5b1dc34a0ea81a1935136.tar.xz
Unrar 5.x Support
Merged #567 (cherry picked from commit c768ad07f53c4109d5cb894f3e9194bfd4c37857)
-rw-r--r--pyload/plugins/internal/UnRar.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/pyload/plugins/internal/UnRar.py b/pyload/plugins/internal/UnRar.py
index 8635483e6..c088c147d 100644
--- a/pyload/plugins/internal/UnRar.py
+++ b/pyload/plugins/internal/UnRar.py
@@ -29,12 +29,14 @@ from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPas
class UnRar(AbtractExtractor):
__name__ = "UnRar"
- __version__ = "0.14"
+ __version__ = "0.15"
# there are some more uncovered rar formats
+ re_version = re.compile(r"(UNRAR 5[\.\d]+ freeware)")
re_splitfile = re.compile(r"(.*)\.part(\d+)\.rar$", re.I)
re_partfiles = re.compile(r".*\.(rar|r[0-9]+)", re.I)
re_filelist = re.compile(r"(.+)\s+(\d+)\s+(\d+)\s+")
+ re_filelist5 = re.compile(r"(.+)\s+(\d+)\s+\d\d-\d\d-\d\d\s+\d\d:\d\d\s+(.+)")
re_wrongpwd = re.compile("(Corrupt file or wrong password|password incorrect)", re.I)
CMD = "unrar"
@@ -90,10 +92,16 @@ class UnRar(AbtractExtractor):
return True
# output only used to check if passworded files are present
- for name, size, packed in self.re_filelist.findall(out):
- if name.startswith("*"):
- self.passwordProtected = True
- return True
+ if self.re_version.search(out):
+ for attr, size, name in self.re_filelist5.findall(out):
+ if attr.startswith("*"):
+ self.passwordProtected = True
+ return True
+ else:
+ for name, size, packed in self.re_filelist.findall(out):
+ if name.startswith("*"):
+ self.passwordProtected = True
+ return True
self.listContent()
if not self.files: