summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
authorGravatar AndroKev <neureither.kevin@gmail.com> 2013-10-27 17:42:19 +0100
committerGravatar AndroKev <neureither.kevin@gmail.com> 2013-10-27 17:42:19 +0100
commit5b71ec94fabd87c267f1dea446c53ef786e1b8f7 (patch)
tree9bbd92112a7942dbacbcf9941c40d0739f94c362 /module/plugins/internal
parentNew hoster and folder: DuploadOrg (diff)
downloadpyload-5b71ec94fabd87c267f1dea446c53ef786e1b8f7.tar.xz
ExtractArchives - add an option to excludefiles
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/AbstractExtractor.py7
-rw-r--r--module/plugins/internal/UnRar.py8
2 files changed, 10 insertions, 5 deletions
diff --git a/module/plugins/internal/AbstractExtractor.py b/module/plugins/internal/AbstractExtractor.py
index 2130f910e..2ba2f2edf 100644
--- a/module/plugins/internal/AbstractExtractor.py
+++ b/module/plugins/internal/AbstractExtractor.py
@@ -27,10 +27,10 @@ class AbtractExtractor:
raise NotImplementedError
- def __init__(self, m, file, out, fullpath, overwrite, renice):
+ def __init__(self, m, file, out, fullpath, overwrite, excludefiles, renice):
"""Initialize extractor for specific file
- :param m: ExtractArchive Hook plugin
+ :param m: Extracd pylctArchive Hook plugin
:param file: Absolute filepath
:param out: Absolute path to destination directory
:param fullpath: extract to fullpath
@@ -42,6 +42,7 @@ class AbtractExtractor:
self.out = out
self.fullpath = fullpath
self.overwrite = overwrite
+ self.excludefiles = excludefiles
self.renice = renice
self.files = [] # Store extracted files here
@@ -90,4 +91,4 @@ class AbtractExtractor:
def getExtractedFiles(self):
"""Populate self.files at some point while extracting"""
- return self.files \ No newline at end of file
+ return self.files
diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py
index da8e7cf3d..00f15791a 100644
--- a/module/plugins/internal/UnRar.py
+++ b/module/plugins/internal/UnRar.py
@@ -29,7 +29,7 @@ from module.plugins.internal.AbstractExtractor import AbtractExtractor, WrongPas
class UnRar(AbtractExtractor):
__name__ = "UnRar"
- __version__ = "0.13"
+ __version__ = "0.14"
# there are some more uncovered rar formats
re_splitfile = re.compile(r"(.*)\.part(\d+)\.rar$", re.I)
@@ -185,6 +185,11 @@ class UnRar(AbtractExtractor):
args = []
#overwrite flag
args.append("-o+") if self.overwrite else args.append("-o-")
+
+ if self.excludefiles != "":
+ for word in self.excludefiles.split(';'):
+ args.append("-x*" + word)
+
# assume yes on all queries
args.append("-y")
@@ -195,7 +200,6 @@ class UnRar(AbtractExtractor):
else:
args.append("-p-")
-
#NOTE: return codes are not reliable, some kind of threading, cleanup whatever issue
call = [self.CMD, command] + args + list(xargs)
self.m.logDebug(" ".join(call))