diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2013-03-26 17:50:21 +0000 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2013-03-26 19:18:07 +0000 |
commit | 9b3ff8f1b80308505d3417c1512772836b6778ab (patch) | |
tree | c4b628c8a18ffd3c42c529909e38c7b786a2c8c8 | |
parent | a44d86f285f33b32c1d7ea99ad779621e69beae9 (diff) | |
download | deluge-9b3ff8f1b80308505d3417c1512772836b6778ab.tar.gz deluge-9b3ff8f1b80308505d3417c1512772836b6778ab.tar.bz2 deluge-9b3ff8f1b80308505d3417c1512772836b6778ab.zip |
Fix #2290 : Extractor: Dotted filenames being rejected
-rw-r--r-- | deluge/plugins/Extractor/deluge/plugins/extractor/core.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/deluge/plugins/Extractor/deluge/plugins/extractor/core.py b/deluge/plugins/Extractor/deluge/plugins/extractor/core.py index f8ccb0b5d..e2ae8c821 100644 --- a/deluge/plugins/Extractor/deluge/plugins/extractor/core.py +++ b/deluge/plugins/Extractor/deluge/plugins/extractor/core.py @@ -134,12 +134,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("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("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"])) |