summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-11-02 20:30:39 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-11-02 20:30:39 +0100
commitedbdf15081e27c680e390aaaa05788e0396376dd (patch)
tree52595439b2a52738ab68746834e3e3cea4695531
parentNew crypter: FreetexthostCom (diff)
parentMerge remote-tracking branch 'upstream/stable' into stable (diff)
downloadpyload-edbdf15081e27c680e390aaaa05788e0396376dd.tar.xz
Merge pull request #351 from AndroKev/stable
ExtractArchives - add an option to excludefiles
-rw-r--r--module/plugins/hooks/ExtractArchive.py9
-rw-r--r--module/plugins/internal/AbstractExtractor.py5
-rw-r--r--module/plugins/internal/UnRar.py9
3 files changed, 14 insertions, 9 deletions
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 2cb546fbb..be023301c 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -59,7 +59,7 @@ class ExtractArchive(Hook):
Provides: unrarFinished (folder, filename)
"""
__name__ = "ExtractArchive"
- __version__ = "0.15"
+ __version__ = "0.16"
__description__ = "Extract different kind of archives"
__config__ = [("activated", "bool", "Activated", True),
("fullpath", "bool", "Extract full path", True),
@@ -68,11 +68,12 @@ class ExtractArchive(Hook):
("deletearchive", "bool", "Delete archives when done", False),
("subfolder", "bool", "Create subfolder for each package", False),
("destination", "folder", "Extract files to", ""),
+ ("excludefiles", "str", "Exclude files from unpacking (seperated by ;)", ""),
("recursive", "bool", "Extract archives in archvies", True),
("queue", "bool", "Wait for all downloads to be finished", True),
("renice", "int", "CPU Priority", 0)]
- __author_name__ = ("pyload Team")
- __author_mail__ = ("admin<at>pyload.org")
+ __author_name__ = ("pyload Team", "AndroKev")
+ __author_mail__ = ("admin<at>pyload.org", "@pyloadforum")
event_list = ["allDownloadsProcessed"]
@@ -177,7 +178,7 @@ class ExtractArchive(Hook):
continue
extracted.append(target) # prevent extracting same file twice
- klass = plugin(self, target, out, self.getConfig("fullpath"), self.getConfig("overwrite"),
+ klass = plugin(self, target, out, self.getConfig("fullpath"), self.getConfig("overwrite"), self.getConfig("excludefiles"),
self.getConfig("renice"))
klass.init()
diff --git a/module/plugins/internal/AbstractExtractor.py b/module/plugins/internal/AbstractExtractor.py
index 2130f910e..ace79e149 100644
--- a/module/plugins/internal/AbstractExtractor.py
+++ b/module/plugins/internal/AbstractExtractor.py
@@ -27,7 +27,7 @@ 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
@@ -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..80ee39cdf 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,7 +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%s" % word )
+
# assume yes on all queries
args.append("-y")
@@ -195,7 +199,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))