Opened 13 years ago
Closed 13 years ago
#2290 closed bug (Fixed)
AutoExtractor Plugin fails to extract files with periods ( . )
| Reported by: | three18ti | Owned by: | Calum |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.3.7 |
| Component: | Plugin | Version: | 1.3.6 |
| Keywords: | Cc: | andareed@gmail.com, a.starr.b@gmail.com |
Description
Hello,
Deluge Version: Client: 1.3.6 Server: 1.3.6
OS: Ubuntu, 12.04.1
Since upgrading to deluge 1.3.6 the auto extractor fails to extract files with periods.
Relevant log excerpt:
attached as deluge_auto_extractor_debug_log_20130304.log
Solution:
Cas suggested reverting this commit might fix the problem: http://git.deluge-torrent.org/deluge/commit/?h=1.3-stable&id=7fbe163c24de
Attachments (5)
Change History (11)
by , 13 years ago
| Attachment: | deluge_auto_extractor_debug_log_20130304.log added |
|---|
comment:1 by , 13 years ago
| Milestone: | Future → 1.3.x |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
| Version: | other (please specify) → 1.3.6 |
comment:3 by , 13 years ago
Although your code works, the result relies on the alphabetical order of the extensions which is not ideal.
This is the code that I put together a few days ago and was looking to commit:
diff --git a/deluge/plugins/extractor/extractor/core.py b/deluge/plugins/extractor/extractor/core.py
index 50f3faf..168fa7d 100644
--- a/deluge/plugins/extractor/extractor/core.py
+++ b/deluge/plugins/extractor/extractor/core.py
@@ -132,11 +132,14 @@ def _on_torrent_finished(self, torrent_id):
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:
+ file_ext = os.path.splitext(f["path"])[1]
+ file_ext_pair = os.path.splitext(os.path.splitext(f["path"])[0])[1] + file_ext
+ if file_ext_pair in EXTRACT_COMMANDS:
+ cmd = EXTRACT_COMMANDS[file_ext_pair]
+ elif file_ext in EXTRACT_COMMANDS:
cmd = EXTRACT_COMMANDS[file_ext]
else:
- log.error("EXTRACTOR: Can't extract unknown file type: %s", file_ext)
+ log.error("EXTRACTOR: Can't extract unknown file type: %s", f["path"])
continue
# Now that we have the cmd, lets run it to extract the files
comment:4 by , 13 years ago
| Cc: | added |
|---|
comment:5 by , 13 years ago
After much testing finally came up with a fix that works properly:
Fixed 1.3-stable: http://git.deluge-torrent.org/deluge/commit/?h=1.3-stable&id=f1074858716
@Andareed: My comment is incorrect, the EXTRACT_COMMANDS dict is not actually sorted so there is no way to know in advance whether for example '.lzma' will be after '.tar.lzma' if that extension is added at a later date and sorting the dict alphabetically would not help either due to the potential of '.xz' and '.tar.xz' co-existing.
by , 13 years ago
| Attachment: | Extractor-0.3-py2.7.egg added |
|---|
by , 13 years ago
| Attachment: | Extractor-0.3-py2.6.egg added |
|---|
comment:6 by , 13 years ago
| Milestone: | 1.3.x → 1.3.7 |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |



Deluge debug log of failed autoextractor attempt