levic92 / lcextractor Goto Github PK
View Code? Open in Web Editor NEWDeluge extractor plugin
License: GNU General Public License v3.0
Deluge extractor plugin
License: GNU General Public License v3.0
This isn't an issue, but I'm curious if someone could point me in the right direction.
I'm running a Synology with Deluge, Sonarr, and Radarr among other things in Docker. I have LCExtractor setup with Deluge and it's working perfectly for extracting and communicating with Sonarr (haven't had a chance to test things with Radarr, but I expect it'll be working well there as well). I've set up the lcextractor_cleanup.py and have connected Sonarr to it per the instructions, but things aren't getting cleaned up. I assume this is due to a lack of access to Python, but I'm not all that well versed with Docker and I'm wondering how best to allow Python access to a Docker container. In this case I would assume Radarr and Sonarr would need to access the Python source as they're the one's calling the cleanup script. I'm just not sure if I'm better off trying to point things to Python on the Synology, running a separate Python container in Docker to handle things, or if I'm entirely off base and that's not likely to be the problem at all.
Any help/insight would be greatly appreciated. I'm so close to getting everything entirely automated!
Hello,
First of all, great tool, thank you! The extractor seems to be working great: Unfortunately, however, I haven't had any luck getting the cleanup script to work in Sonarr. I get the following error in the logs after running the cleanup, any ideas?
05/12/2020 19:25:11 - INFO - [downloadname*] Starting lcextractor_cleanup in mode: sonarr
05/12/2020 19:25:12 - ERROR - [[downloadname*] Error in web request for download: db86e2b2a86496811b16fffe87e3c1af721**** downloadname*
05/12/2020 19:25:12 - ERROR - [[downloadname*] <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate chain too long (_ssl.c:1108)>
OS Name: Microsoft Windows Server 2016 Standard
OS Version: 10.0.14393 N/A Build 14393
Deluge Version: deluge-1.3.15-py2.7
Sonarr Version: 2.0.0.5344
Python Version: 3.8.3rc1
Deluge Web: SSL, Port 443, certificate signed by internal CA (root, then client cert)
Sonarr has the path configured to point to the python.exe binary, and the argument points to the script. Deluge downloads the files, moves them all the a NAS. The LCExtractor plugin then extracts the file. Sonarr successfully copies the extraced file to my media directory folder, and then calls the script. The script then spits out the SSL error. I have tried both a https URL with not port designation in the configuration, as well as with a :443, both do not seem to work. The deluge web certificate algo is Sha256RSA.
# arguments set by user deluge_url = 'https://deluge.*****.net/json' deluge_password = '******' move_extraced_to = None # set this if you want to move files instead of delete (set to None for delete)
LCExtractor setting in Deluge:
Extract to: blank
[x]Enable Support for Sonarr and radarr
[x]Extract In Place
[] Create torrent name subfolder
*EDIT
Note that this error only occurs sometimes. Sometimes, it seems to delete the file jsut fine, from the same location. its very strange, Im not sure why sometimes it throws this error, and sometimes it doesn't.
05/13/2020 13:41:28 - INFO - [****] Starting lcextractor_cleanup in mode: sonarr
05/13/2020 13:41:31 - INFO - [] Deleted: \nas..net\nas\Downloads\sonarr**.mkv
05/13/2020 14:24:58 - INFO - [****] Starting lcextractor_cleanup in mode: sonarr
05/13/2020 14:24:59 - ERROR - [****] Error in web request for download: 15ab070c7b93872480604285887ab891b4baa4b9 ****
05/13/2020 14:24:59 - ERROR - [****] <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate chain too long (_ssl.c:1108)>
05/13/2020 14:36:59 - INFO - [****] Starting lcextractor_cleanup in mode: sonarr
05/13/2020 14:37:02 - INFO - [] Deleted: \nas..net\nas\Downloads\sonarr**.mkv
Both Deluge and Sonarr are on the latest stable version.
It also got removed from the queue in Sonarr.
I'm on windows 10 and put in these pointing at my python.exe and the lcextactor_cleanup.py but it doesn't appear to do anything no log file created or anything.
Path - C:\Python27\python.exe
Arguments - E:\LCExtractor Cleanup\lcextractor_cleanup.py
On Download - yes
On Upgrade - yes
On Rename - no
On Grab - no
If I double click the lcextractor_cleanup.py I get this in the log
12/03/2017 21:19:07 - INFO - [] Starting lcextractor_cleanup in mode: sonarr
12/03/2017 21:19:07 - ERROR - [] Missing required variables
12/03/2017 21:19:07 - ERROR - [] deluge_url: http://127.0.0.1:8112/json, download_id: , sourcepath: , destpath: , download_name:
Am I doing something obviously wrong here? I get to deluge from localhost:8112 and password deluge so I assume the json/password are fine.
07/08/2019 14:41:49 - INFO - [TV.Show.Name.S0.E0.multi.1080p.bluray.x264] Starting lcextractor_cleanup in mode: sonarr
07/08/2019 14:41:50 - ERROR - [TV.Show.Name.S0.E0.multi.1080p.bluray.x264] Error in web request for download: 1c8b1dd745dd5af2c481d2b6df619a4bdc1bd64e TV.Show.Name.S0.E0.multi.1080p.bluray.x264
07/08/2019 14:41:50 - ERROR - [TV.Show.Name.S0.E0.multi.1080p.bluray.x264] expected string or bytes-like object
Here's my log not sure what the issue could be
Hey All,
Trying to get a Sonarr + Deluge solution running smoothly. I came across this plugin and was hoping to get it working. Unfortunately it does not seem to want to extract and gives me an error in the Deluge logs:
[ERROR ] 10:33:05 eventmanager:59 Event handler TorrentFinishedEvent failed in <bound method Core._on_torrent_finished of <lcextractor.core.Core object at 0x040AE7B0>> with exception (2, 'CreateProcess', 'The system cannot find the file specified.')
I have tried both 32 and 64 bit 7zip (as recommended by another thread) but in my case, there is no change.
Just before this error, I see that 'EXTRACTOR" is also trying to run - Although my understanding is that lcextractor uses the base extractor, so maybe that is normal? I wanted to mention this just in case.
[DEBUG ] 10:33:05 core:212 EXTRACTOR: Extracting F:!NetShare\T\done\downloadedfile.rar from 5684820344f98277f6c9f187790a55682b2d54df with 7z.exe x -y to F:!NetShare\T\done
Thoughts?
I'd like to see a feature where LCExtractor can delete the extracted files after X minutes, for those who don't use sonarr/radarr.
Yo brotha.
Have you done any work on this lately?
Trying to figure out how to remove the leftover extracted file once sonarr/radarr imports it.
Any ideas?
My environment:
Windows 10P x64 1703
Deluge: 1.3.15
Python: 2.7.13
First, GREAT WORK!!!
So a couple UI questions:
1 - So, IF extract in place is checked, then it doesn't use the specified "extract to" path? Kinda confusing, does it extract to the specified folder, OR in place?
2 - What exactly does sonarr/radarr support do? There's no options to config a API call, so just wondering.
So, tested a simple in place extraction, WITH the label auto move enabled- and it worked! So that's dope! (as you know, simple extraction is easy, but getting it to work with labels that auto-move after completion hasn't been mastered yet, until this! )
Gotta test with a sonarr/radarr manual grab, Will report back.
Great work man!
It would be nice if one could append label (if it's set) to path when extracting, eg.
/path/to/dir/label/
So when one has enabled extract to subfolder it could look like this
/path/to/dir/label/torrent name
This would be great for sorting stuff
Love this plugin so far and I'm a daily user of it, really glad you took it upon yourself to solve this problem that a lot of us have! I only have one small annoyance with it.
The plugin cannot differentiate between the different torrent groupings (labels) so everything I download gets extracted. Personally, I have 2-3 different labels that I would prefer get auto-extracted, and leave everything else alone.
I don't know if you're able to parse torrent labels from deluge and add some sort of "if label=INSERT_LABEL then extract" kind of deal, but that would certainly be great for my use case, and I'm sure a lot of other people would like such a feature as well.
If checking torrent labels isn't an option, perhaps verify the move-on completion paths of the torrent-files before extraction (only things located under a certain folder gets extracted, everything else gets left alone).
That being said, love the work and really appreciate it!
Hi
Now that Deluge has iterated to 2.0 and python 3 are there any plans to migrate this awesome plugin?
Cheers,
Neil
Anyone else seeing this error in the clean-up script?
09/21/2019 18:07:07 - INFO - [QI.S17E03.Quarrels.1080p.HDTV.x264-LiNKLE] Starting lcextractor_cleanup in mode: sonarr
09/21/2019 18:07:07 - ERROR - [QI.S17E03.Quarrels.1080p.HDTV.x264-LiNKLE] Error in web request for download: 45d736a6a925d661eeeda8607e3527155b18a5aa QI.S17E03.Quarrels.1080p.HDTV.x264-LiNKLE
09/21/2019 18:07:07 - ERROR - [QI.S17E03.Quarrels.1080p.HDTV.x264-LiNKLE] Not a gzipped file
LCExtractor has been working well for processing however I've been using it in combination with the aforementioned mp4 automator script ( https://github.com/mdhiggins/sickbeard_mp4_automator/blob/master/README.md ) and currently, once the file is exctacted (usually an mkv) Sonarr picks up the file and copies it to the destination folder, then the automator script is called by Sonarr and the mkv is converted to an mp4, the copy of the mkv in the destination folder is then deleted. Only trouble comes is when lcextractor_cleanup.py is called it can't find the imported file (this appears in the log) as the remaining converted mp4 file doesn't match the original mkv in the source directory.
I don't know a lick of Python (or any other language for that matter) and I've looked through the script to see if I can understand what it's doing, but I guess the check is happening at if os.path.exists(destpath):
though I don't know if setting destpath or a new variable to sonarr_deletedpaths or sonarr_deletedrelativepaths would accomplish what I'm looking to do, or whether those environment variables would even contain the path to the original mkv file. Any ideas that might push me in the right direction?
Cheers!
What would be the best way to get this plugin setup if I’m running deluge for VPN and Sonarr and Radarr on two different systems?
First time user. TV Series are working perfect! However when downloading movie releases (with a separate Subs directory, in that directory there is a .subs.rar file) it is not working as expected. Tested with multiple releases.
Maybe this is a configuration setting/issue, but at the moment only the subs.rar is extracted and the rar containing the .mkv is left intact.
Any idea what this means and how to fix it?
Traceback (most recent call last):
File "deluge\pluginmanagerbase.py", line 144, in enable_plugin
File "c:\config_location\plugins\lcextractor-0.6.2-py2.7.egg\lcextractor_init_.py", line 44, in init
from core import Core as _plugin_cls
File "c:\config_location\plugins\lcextractor-0.6.2-py2.7.egg\lcextractor\core.py", line 119, in
NameError: name 'EXTRACT_COMMANDS' is not defined
Unable to instantiate plugin!
name 'EXTRACT_COMMANDS' is not defined
Could you maybe point at what I am doing wrong here? It happens on every download I believe.
`
lcextractor_cleanup.py | [The.Hitman's.Bodyguard.2017.BluRay.1080p.DTS.x264-PRoDJi] <urlopen error [Errno 61] Connection refused> | Last Tuesday |
---|---|---|
lcextractor_cleanup.py | [The.Hitman's.Bodyguard.2017.BluRay.1080p.DTS.x264-PRoDJi] Error in web request for download: 3f0ceb855b54020f4c55e9d50858da8ea4894efd The.Hitman's.Bodyguard.2017.BluRay.1080p.DTS.x264-PRoDJi | |
lcextractor_cleanup.py | [Deck.the.Halls.2006.720p.BRRip.x264-x0r] <urlopen error [Errno 61] Connection refused> | |
lcextractor_cleanup.py | [Deck.the.Halls.2006.720p.BRRip.x264-x0r] Error in web request for download: e7062c1f34cc0dc43c1b2ca836d77de9db59d2e5 Deck.the.Halls.2006.720p.BRRip.x264-x0r | |
lcextractor_cleanup.py | [The House with a Clock in Its Walls.2018.1080p.WEB-DL.H264.AC3-EVO] <urlopen error [Errno 61] Connection refused> | |
lcextractor_cleanup.py | [The House with a Clock in Its Walls.2018.1080p.WEB-DL.H264.AC3-EVO] Error in web request for download: 89aafe612067572e86768e6bf77e61b671a75917 The House with a Clock in Its Walls.2018.1080p.WEB-DL.H264.AC3-EVO | |
lcextractor_cleanup.py | [Halloween.2018.REPACK.720p.HDRip.BLURRED.AC3.X264-CMRG] <urlopen error [Errno 61] Connection refused> | |
lcextractor_cleanup.py | [Halloween.2018.REPACK.720p.HDRip.BLURRED.AC3.X264-CMRG] Error in web request for download: debdcc06d3a999d12aa7c9c7b34ad54085650bb3 Halloween.2018.REPACK.720p.HDRip.BLURRED.AC3.X264-CMRG |
`
Are you able to explain some of the settings?
I have the following config
{
"file": 1,
"format": 1
}{
"use_name_folder": false,
"sonarr_radarr_support": true,
"extract_path": "/data/incomplete",
"in_place_extraction": true
}
completed files are moved to /data/completed, however when the plugin runs its extracting the file to the root of the directory /data/completed.
Have in place extraction set to true I thought it would extract to whatever the location of the torrent data is in (if there is one).
Am I missing something here, I guess I could just use the folder name but that might be off if the torrent is just single file which happens from time to time.
Hi,
I'm trying to use your script to remove the unrar'ed file once it has been imported into Radarr but I get the following errors. I feel I'm missing something basic or obvious but I'm not experienced enough with Linux or Python to discover what. Any thoughts or suggestions gratefully received.
04/08/2019 21:30:38 - INFO - [Film.2017.SUBBED.DVDRip.x264-scene] Starting lcextractor_cleanup in mode: radarr
04/08/2019 21:30:39 - ERROR - [Film.2017.SUBBED.DVDRip.x264-scene] Error in web request for download: e8a17141b5eb02d588fde7681e95f51d31be3762 Film.2017.SUBBED.DVDRip.x264-scene
04/08/2019 21:30:39 - ERROR - [Film.2017.SUBBED.DVDRip.x264-scene] ''
Hey @levic92 ,
There's some type of bug where the settings for the plug-in aren't sticking after you make changes to the server via the thin client. If I make the changes ON the box that is hosting deluged-debug via the GTK UI, hit apply, exit the thin client (so the servcie is still running), and then re-launch the thin-client, the plug-in is still enabled, but all settings are default. What is weird, is that the functionaly is still working....so it MAY just be a UI thing?!
I'm not sure how you've tested this. This MIGHT be my particular environment. However, I did test on two diff windows hosts, and the issue was present on both.
Not sure if you have the tools to reproduce, but if not, I can do a teamviewer so I can show you, but it's def there.
LMK.
Yo @levic92 been seeing this error a few times. Has been working but I would say I get this about 25% of the time. Not sure what's causing it. It extracts fine, and the script runs, but doesn't remove it. with the errors below.
Dec 02 21:35:14 LCExtractor lcextractor_cleanup.log: 12/02/2017 21:35:13 - INFO - [Outlander.S03E12.WEB.H264-STRiFE] Starting lcextractor_cleanup in mode: sonarr
Dec 02 21:35:17 LCExtractor lcextractor_cleanup.log: 12/02/2017 21:35:16 - INFO - [Outlander.S03E12.WEB.H264-STRiFE] This file was not in an archive
So I was here quite some time ago in somebody else's issue thread trying to get this working and eventually it randomly started working for about a month but I'm back to it not working again.
If I run C:\Program Files (x86)\Deluge\deluged-debug.exe -L debug -l "D:\Library\deluge.log" I get no error messages and it appears to be loaded/enabled properly at the beginning.
{
"file": 1,
"format": 1
}{
"use_name_folder": true,
"sonarr_radarr_support": true,
"extract_path": "D:\Downloads",
"in_place_extraction": true
}
Those are my config settings which seem fine. The cmd window (or w/e u call it) appears after the torrent is finished downloading like it is going to extract, then immediately closes instead of staying open for a bit and extracting.
This has been an intermittent issue basically the whole time I've used this (pretty much from when it was made) sometimes it works, sometimes it doesn't. Sometimes it fails everything for weeks, bout the longest it ever worked 100% was that one month. Sometimes it works then an hour later it doesn't then the next morning it works again. I've tried 64 bit and 32 bit 7 zip.
Any advice or some other way to debug would be great.
Error processing deluge api response
Any idea what causes this error?
Dear Levic92, dear members of the Community,
I'm a newbie regarding python and so I don't understand some things. I hope you'll have the patience to help me understand how to configure everything correctly. Thank you in advance.
Sonarr: 2.0.0.5085
Radarr: 0.2.0.910
Deluge: 1.3.15
Windows: 10 pro@64
LCExtractor-0.6.2-py2.7.egg
a. General settings
Every time I close and re-open Deluge I loose all the settings.
I installed a clean version of Deluge, deleted every languages except english to force to use EN, started as an administrator, reinstalled various times,... nothing to do :(
It always revert back to my user folder and the checkbox does not stay checked.
lcextractor_cleanup.py
a. json api endpoint for deluge web service
I opened the script to see what is the deluge_url: http://127.0.0.1:8112/json (default)
I tried to click the link to see if it's correct, I got: "This page isn’t working If the problem continues, contact the site owner. HTTP ERROR 405"
If I go to http://127.0.0.1:8112/ I got the web interface.
It is correct to see a 405 error from the browser?
b. Sonarr Setup
Path - Full path to your python executable
where do I find this?
c. Radarr Setup
As I said I don't understand much of python and scripts.py. I hope you can point me in the right direction so I can use too this wonderful script.
Thank you for your time and your patience. talpazzo
I've come upon a pretty annoying edge-case where a torrent contains two archives.
The first archive is an archive with the subtitles and a nested archive within itself.
The second archive is an archive of the movie.
Because unrar is run with -o+
the movie archive gets overwritten resulting in the movie being lost.
Best illustrated like this:
...
The big question is why would someone do it like this and i don't really have an answer to that but it has happened to me enough times to be a problem.
One way to resolve this would be to run unrar with the -or
flag which renames files that would otherwise overwrite another file. In the above example ubuntu.rar
would become ubuntu (1).rar
As for the other commands i haven't really looked into alternatives to rename instead of overwrite.
I installed the plugin, on windows, with deluge running as a service
I enabled the plugin
I installed 7zip
It does not unrar the torrent after finish.
Am I missing a step here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.