summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/UnTar.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2016-06-17 05:50:38 +0200
committerGravatar GitHub <noreply@github.com> 2016-06-17 05:50:38 +0200
commit8f3bc7699d27784dc75fdaa43150a7a70722aea8 (patch)
treef4f0a7a7173b254e56fa0fc57ab2a0c48b566e9e /module/plugins/internal/UnTar.py
parent[UptoboxCom] fix #2506 (diff)
parentUnRar FIX file exclusion not working (diff)
downloadpyload-8f3bc7699d27784dc75fdaa43150a7a70722aea8.tar.xz
Merge pull request #2500 from robbi/fix/#2168
ExtractArchive Fix/#2168
Diffstat (limited to 'module/plugins/internal/UnTar.py')
-rw-r--r--module/plugins/internal/UnTar.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/module/plugins/internal/UnTar.py b/module/plugins/internal/UnTar.py
index f2a140ca7..13a233634 100644
--- a/module/plugins/internal/UnTar.py
+++ b/module/plugins/internal/UnTar.py
@@ -12,7 +12,7 @@ from module.plugins.internal.misc import encode
class UnTar(Extractor):
__name__ = "UnTar"
__type__ = "extractor"
- __version__ = "0.01"
+ __version__ = "0.02"
__status__ = "stable"
__description__ = """TAR extractor plugin"""
@@ -25,7 +25,10 @@ class UnTar(Extractor):
@classmethod
def isarchive(cls, filename):
- return tarfile.is_tarfile(encode(filename))
+ try:
+ return tarfile.is_tarfile(encode(filename))
+ except:
+ return False
@classmethod
@@ -35,7 +38,8 @@ class UnTar(Extractor):
def list(self, password=None):
with tarfile.open(self.target) as t:
- return t.getnames()
+ self.files = t.getnames()
+ return self.files
def verify(self, password=None):
@@ -53,11 +57,13 @@ class UnTar(Extractor):
def extract(self, password=None):
- self.verify()
+ self.verify(password)
try:
with tarfile.open(self.target, errorlevel=2) as t:
t.extractall(self.dest)
+ self.files = t.getnames()
+ return self.files
except tarfile.ExtractError, e:
self.log_warning(e)