[Plugin] Extractor Plus (Formerly SimpleExtractor)

Suggest, post, or discuss plugins for Deluge
Post Reply
digitalhigh
Member
Member
Posts: 13
Joined: Thu Oct 24, 2019 3:37 am

[Plugin] Extractor Plus (Formerly SimpleExtractor)

Post by digitalhigh »

Well, hello there.

Yes, it's me again.

I'm here today to tell you about the new plugin I've released, "Extractor Plus".

https://github.com/d8ahazard/deluge-ext ... lus-plugin

"But, don't you already have a plugin that looks just like this?"

Well, yes. Yes I do. And while that plugin is pretty great, there was a lot of stuff under the hood that just always kinda irked me, but it worked for the most part and so I just let it be.

But then, a few days ago, I finally got irritated with "certain" other automated apps that talk to Deluge occasionally copying partially-extracted files to their final destination, only for me to have to go back later and fix the broken files.

So, I started looking at the code again. And, the more I looked at it, the more room I found for improvement.

For example: The plug-in was originally based on the V1 Simple Extractor Plugin, then sorta "merged" with parts from the Extractor plugin to get working with Deluge V2...but I never actually bothered to fix a .tar.* extensions under Windows that *could* be extracted, but just weren't.

Or, for Linux commands, there were several listed "required" applications that are checked for, but never actually used anywhere.


But, I digress. Here's a list of the features, plus fixes and changes from SimpleExtractor to Extractor Plus:

Image

Features

Select extraction location: All files to torrent root, all files "in-place", or all files to a specific directory.

Optional label-based filtering: Extract only torrents with specific labels. Supports the native "Label" plugin, as well as "LabelPlus".

Optional label-based extraction location: If "extract to directory" is specified and this is enabled, it will append the label of the media to the extraction path.

Optional "extract to temp first" feature: Instead of extracting where other apps might be watching for files, this will instead extract to a temp directory and then move the files once completed...reducing the risk of incomplete file copies from other apps.

No External Dependencies: For windows and *most* Linux distributions, no other external dependencies should be required. This includes python packages.


Image


What's New

1. Added "extract to temp folder" option. I highly recommend this. When enabled, it will extract any found archive(s) to the OS-specific /temp folder, then moves the files to the destination when completed extracting. This eliminates my most long-standing irritation as mentioned above.

2. Added an "append label to destination" option when extracting to a specific folder. So, if the output folder is "/downloads/extracted" and the file is labeled with "movie", it will be extracted to "/downloads/extracted/movie". Only works for the first matched label.

3. Added support for all of the .tar.* or .t** file extensions (tar compressed into something else). Previously, they just wouldn't work because it took two commands to do. Tested on xz, gz, lzma/7z and bzip2 types.

4. Added the windows 7z executable right to the .egg for the plugin. No more installing extra dependencies for windoze users.

5. Completely refreshed the UI. Fixed a lot of tiny inconsistencies and weirdness that came with not really understanding how the UI(s) worked, added a few sanity features like hiding/showing the destination folder options only when needed and tooltips, and ensured that the web UI and GTK3 UI were identical.

6. Massively overhauled the backend as well. Instead of just splicing code between two existing plugins and praying until it worked, I actually went through every method and every file and made sure stuff was efficient and right.


Fin

Readme and installation instructions are here:
https://github.com/d8ahazard/deluge-ext ... gin#readme

You can download the latest version of the plugin here:
https://github.com/d8ahazard/deluge-ext ... es/tag/1.5

And if you really like this and want to buy me a beer, you can do that here:
https://www.paypal.com/donate/?hosted_b ... DAVB2WBJEC

Also, I'm not on this forum very much, so if you have an issue, the best way to report it is on Github:
https://github.com/d8ahazard/deluge-ext ... gin/issues

Last, but definitely not least, massive props to Cvarta for the original SimpleExtractor which was the starting point of this plugin, and Andrew Resch and Martijn Voncken for the original Extractor V2 plugin which was the other "donor" I used to get SEV2 working.
Last edited by digitalhigh on Mon May 23, 2022 9:46 pm, edited 1 time in total.
digitalhigh
Member
Member
Posts: 13
Joined: Thu Oct 24, 2019 3:37 am

Re: [Plugin] Extractor Plus (Formerly SimpleExtractor)

Post by digitalhigh »

Reserved...
digitalhigh
Member
Member
Posts: 13
Joined: Thu Oct 24, 2019 3:37 am

Re: [Plugin] Extractor Plus (Formerly SimpleExtractor)

Post by digitalhigh »

Just posted release 1.6.1. This includes a new feature, "Auto-cleanup". With auto-cleanup enabled, you basically specify a delay period in hours. The plugin will track each extracted file, and check it's modified time every minute. Once an extracted file reaches a specific age in hours, it will be deleted.

https://github.com/d8ahazard/deluge-ext ... /tag/1.6.1

I added this feature as a space-saving feature, as in 99% of the cases for my setup, extracted files really only need to be in place for a few minutes until Sonarr/Radarr detect and copy them.


Additional changes include the following:

Fix an issue where extracting multiple files "in-place" would potentially cause all extracted files to be placed in the last "scanned" directory, versus each file to it's respective directory.

Append a "temporary" file extension when copying files from temp. Previously, files would be extracted to temp, then moved to their home dir with their "final" extension. This still left a period of time where a file could be copied by one of the Darr apps before it was finished. Now, we move the file and append ".extplus" to the file name, then rename it once moved. This should greatly reduce the chance of incomplete file copies.
TheMonDon
New User
New User
Posts: 1
Joined: Tue Jun 14, 2022 3:59 pm

Re: [Plugin] Extractor Plus (Formerly SimpleExtractor)

Post by TheMonDon »

I just created an account to say thank you, this plugin is definitely one of the best things I use for deluge. You are awesome, keep it up.
digitalhigh
Member
Member
Posts: 13
Joined: Thu Oct 24, 2019 3:37 am

Re: [Plugin] Extractor Plus (Formerly SimpleExtractor)

Post by digitalhigh »

Release 1.6.2 is UP!

Only change is the addition of a (requested) "Append Archive Name" option in the extraction behaviors.

When enabled, a folder with the name of the extracted archive will be created in the extract destination, and all files in the archive will be extracted/copied there.

https://github.com/d8ahazard/deluge-ext ... /tag/1.6.2


TheMonDon wrote: Tue Jun 14, 2022 4:01 pm I just created an account to say thank you, this plugin is definitely one of the best things I use for deluge. You are awesome, keep it up.
Hey, thanks! I appreciate the kind words.

Like most of my coding projects, this plugin came about because I had a very specific need for functionality that didn't exist.

As I've learned more about the APIs and UI stuff, I got more comfortable adding and changing stuff, which is where we are today. I'm always happy to hear someone else is using and enjoying my work. :D
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Plugin] Extractor Plus (Formerly SimpleExtractor)

Post by mhertz »

Just quickly wanted to say thank you so much for this awesome contribution and all the work you put into this! :) I was much impressed since you initially posted about it, and now also had a chance to test it out, which worked great. Thanks!
diago767
New User
New User
Posts: 4
Joined: Sat Jul 30, 2022 2:47 pm

Re: [Plugin] Extractor Plus (Formerly SimpleExtractor)

Post by diago767 »

Thanks so much for the plugin, simple extractor was driving me nuts with exactly the problem you mentioned XD

I've run into a new issue though and I've been tearing my hair out trying to figure it out, before downloading your plugin I was using version 1.3.15 which is using an older version of python that isnt compatible, so I upgraded to 2.1.1 and everything seemed to be fine, Sonarr was talking to it, downloads were sent to the client fine, but when it completes Sonarr doesnt seem to notice that its finished even though its getting feedback from Deluge as it has an accurate progress bar, but it sits on 100% with it marked as "Downloading" and never moves any further forwards. Any ideas? I tried rolling back one version to 2.1.0 but that didn't help. Also tried it with a different torrent client and it works fine with that, just doesnt seem to like the new version of Deluge.

Edit: the plugin works great though :P and ive tested the issue with downloads that dont need anything extracted so I know that isn't the problem.
digitalhigh
Member
Member
Posts: 13
Joined: Thu Oct 24, 2019 3:37 am

Re: [Plugin] Extractor Plus (Formerly SimpleExtractor)

Post by digitalhigh »

diago767 wrote: Sat Jul 30, 2022 2:53 pm Thanks so much for the plugin, simple extractor was driving me nuts with exactly the problem you mentioned XD

I've run into a new issue though and I've been tearing my hair out trying to figure it out, before downloading your plugin I was using version 1.3.15 which is using an older version of python that isnt compatible, so I upgraded to 2.1.1 and everything seemed to be fine, Sonarr was talking to it, downloads were sent to the client fine, but when it completes Sonarr doesnt seem to notice that its finished even though its getting feedback from Deluge as it has an accurate progress bar, but it sits on 100% with it marked as "Downloading" and never moves any further forwards. Any ideas? I tried rolling back one version to 2.1.0 but that didn't help. Also tried it with a different torrent client and it works fine with that, just doesnt seem to like the new version of Deluge.

Edit: the plugin works great though :P and ive tested the issue with downloads that dont need anything extracted so I know that isn't the problem.
That is interesting. Unfortunately, I'm not running a 2.1.x version of Deluge at the moment. I'm using 2.0.5 in docker on UnRAID to talk to Sonarr, and that works fine.

I'll have to see if I can find a docker version of 2.1.x and test it. Generally, what is supposed to happen, is that the download completes, the plugin catches this and marks the file as "paused" while the torrent is being extracted, then Sonarr will do the scan once the extracted file is renamed to it's approprate media extensions from ".extplus" - and the torrent is unpaused.

What OS are you running Deluge on? I've tested on Docker under UnRAID and Windows, but not native linux.

LMK, and I'll see if I can reproduce the issue and get to the root of the problem.

Also, if you could kindly share your settings for extraction, that would help as well. :D
diago767
New User
New User
Posts: 4
Joined: Sat Jul 30, 2022 2:47 pm

Re: [Plugin] Extractor Plus (Formerly SimpleExtractor)

Post by diago767 »

digitalhigh wrote: Sun Jul 31, 2022 5:09 pm
diago767 wrote: Sat Jul 30, 2022 2:53 pm Thanks so much for the plugin, simple extractor was driving me nuts with exactly the problem you mentioned XD

I've run into a new issue though and I've been tearing my hair out trying to figure it out, before downloading your plugin I was using version 1.3.15 which is using an older version of python that isnt compatible, so I upgraded to 2.1.1 and everything seemed to be fine, Sonarr was talking to it, downloads were sent to the client fine, but when it completes Sonarr doesnt seem to notice that its finished even though its getting feedback from Deluge as it has an accurate progress bar, but it sits on 100% with it marked as "Downloading" and never moves any further forwards. Any ideas? I tried rolling back one version to 2.1.0 but that didn't help. Also tried it with a different torrent client and it works fine with that, just doesnt seem to like the new version of Deluge.

Edit: the plugin works great though :P and ive tested the issue with downloads that dont need anything extracted so I know that isn't the problem.
That is interesting. Unfortunately, I'm not running a 2.1.x version of Deluge at the moment. I'm using 2.0.5 in docker on UnRAID to talk to Sonarr, and that works fine.

I'll have to see if I can find a docker version of 2.1.x and test it. Generally, what is supposed to happen, is that the download completes, the plugin catches this and marks the file as "paused" while the torrent is being extracted, then Sonarr will do the scan once the extracted file is renamed to it's approprate media extensions from ".extplus" - and the torrent is unpaused.

What OS are you running Deluge on? I've tested on Docker under UnRAID and Windows, but not native linux.

LMK, and I'll see if I can reproduce the issue and get to the root of the problem.

Also, if you could kindly share your settings for extraction, that would help as well. :D
Thanks I'd be facinated to see if you could reproduce. For the record, its doing it with all torrents whether they need extracted or not, this is all on win10. Extraction settings are set to "in place" and "extract to temp and move".

I thought I had fixed it by reinstalling everything from scratch and it appeared to be working initially but its gone back to this behaviour now, there was also a period where using the force recheck option in deluge after the torrent had completed would seem to give sonarr a kick and it would import, but thats not working either now.
Radarr also had a moment of madness and was doing the same thing but it seems to have recovered and is working fine now and I have no clue why :shock:
scrappysphinx
New User
New User
Posts: 1
Joined: Mon Oct 03, 2022 9:53 pm

Re: [Plugin] Extractor Plus (Formerly SimpleExtractor)

Post by scrappysphinx »

Hi, i have a Synology DS418 NAS and run Radarr and Sonarr on it. The nas runs from a Realtek CPU so Docker is not an option and i am using the synocommunity repo to install my apps. I was using transmission client for downloading but it cannot extract archived files and its gotten quite tedious to do this manually then import them. I read that Deluge can do this with the Extractor Plus plugin. I've installed Deluge (version 2.1.1-17) which says Python 3.10 and got it working for downloads. I have downloaded the latest ExtractorPlus-1.6.2-py3.10.egg and have used the plugin in preferences to install the Extractor but in preferences i don't the extractor plus option just an extractor section. I have enabled this and it does extract the files when the download finishes but Radarr and Sonarr both fail to import and i believe this is because deluge is reporting the torrent as complete before extraction is complete so the import fails and then i still have to manually import the download. Any tips on how i can fix this?

Thanks for any insight you might be able to offer :)
Deluge.jpg
Deluge.jpg (92.72 KiB) Viewed 10115 times
Prefs.jpg
Prefs.jpg (43.96 KiB) Viewed 10115 times
Extractor.jpg
Extractor.jpg (31.11 KiB) Viewed 10115 times
Post Reply