summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-04-02 16:52:03 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-04-02 16:52:03 +0200
commit6260e02b65d3be072c8392c3b2e36ef47d215c41 (patch)
tree505410a7b87e74752da6220cc97fa93fc6795212 /module
parentDebridItaliaCom: new hoster supported (diff)
downloadpyload-6260e02b65d3be072c8392c3b2e36ef47d215c41.tar.xz
Unrar also deletes .r* files
Diffstat (limited to 'module')
-rw-r--r--module/plugins/internal/UnRar.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index 240dc0233..ef04f558e 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -28,12 +28,13 @@ from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPas
class UnRar(AbtractExtractor):
__name__ = "UnRar"
- __version__ = "0.11"
+ __version__ = "0.12"
# there are some more uncovered rar formats
- re_splitfile = re.compile(r"(.*)\.part(\d+)\.rar$")
+ 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_wrongpwd = re.compile("(Corrupt file or wrong password|password incorrect)")
+ re_wrongpwd = re.compile("(Corrupt file or wrong password|password incorrect)", re.I)
CMD = "unrar"
@staticmethod
@@ -139,7 +140,9 @@ class UnRar(AbtractExtractor):
def getDeleteFiles(self):
if ".part" in self.file:
return glob(re.sub("(?<=\.part)([01]+)", "*", self.file, re.IGNORECASE))
- return [self.file]
+ # get files which matches .r* and filter unsuited files out
+ parts = glob(re.sub(r"(?<=\.r)ar$", "*", self.file, re.IGNORECASE))
+ return filter(lambda x: self.re_partfiles.match(x), parts)
def listContent(self):
command = "vb" if self.fullpath else "lb"