summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2013-03-26 17:50:21 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2013-03-26 18:35:37 +0000
commitf1074858716df0cbca6bb8f6ce2c88f2ab826f00 (patch)
treeb793cbf51afd7ef58217fc26c5d101857d883ef9
parent984691f74cf81d287e604fda90951ec8bfde6df7 (diff)
downloaddeluge-f1074858716df0cbca6bb8f6ce2c88f2ab826f00.tar.gz
deluge-f1074858716df0cbca6bb8f6ce2c88f2ab826f00.tar.bz2
deluge-f1074858716df0cbca6bb8f6ce2c88f2ab826f00.zip
Fix #2290 : Extractor: Dotted filenames being rejected
-rw-r--r--deluge/plugins/extractor/extractor/core.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/deluge/plugins/extractor/extractor/core.py b/deluge/plugins/extractor/extractor/core.py
index 50f3faf26..a07a60ed7 100644
--- a/deluge/plugins/extractor/extractor/core.py
+++ b/deluge/plugins/extractor/extractor/core.py
@@ -132,12 +132,14 @@ class Core(CorePluginBase):
files = tid.get_files()
for f in files:
cmd = ''
- file_ext = os.path.splitext(os.path.splitext(f["path"])[0])[1] + os.path.splitext(f["path"])[1]
- if file_ext in EXTRACT_COMMANDS:
- cmd = EXTRACT_COMMANDS[file_ext]
- else:
- log.error("EXTRACTOR: Can't extract unknown file type: %s", file_ext)
+ file_root, file_ext = os.path.splitext(f["path"])
+ file_ext_sec = os.path.splitext(file_root)[1]
+ if file_ext_sec and file_ext_sec + file_ext in EXTRACT_COMMANDS:
+ file_ext = file_ext_sec + file_ext
+ elif file_ext not in EXTRACT_COMMANDS or file_ext_sec == '.tar':
+ log.warning("EXTRACTOR: Can't extract file with unknown file type: %s" % f["path"])
continue
+ cmd = EXTRACT_COMMANDS[file_ext]
# Now that we have the cmd, lets run it to extract the files
fpath = os.path.join(tid_status["save_path"], os.path.normpath(f["path"]))