clinton-hall / nzbToMedia

Provides NZB and Torrent postprocessing To CouchPotatoServer, SickBeard/SickRage, HeadPhones, Mylar and Gamez
GNU General Public License v3.0
674 stars 176 forks source link

SABnzbd -> Radarr Post-processing SyntaxError #1859

Closed zilwah closed 7 months ago

zilwah commented 3 years ago

File "/share/CACHEDEV1_DATA/.qpkg/nzbToMedia/nzbToMedia/nzbToRadarr.py", line 255 from future import ( ^ SyntaxError: from future imports must occur at the beginning of the file

Note: Post-processing is completed however above error message is reported in SABnzbd

clinton-hall commented 3 years ago

Have you made any changes to the nzbToRadarr.py file? This file needs to be un-changed. None of the # lines should be uncommented etc. All Config needs to be changed through the autoProcessMedia.cfg file

zilwah commented 3 years ago

@clinton-hall thx for the prompt response, yes I recently moved from CouchPotato to Radarr and post-processing wasn't working well ("Completed") folder was not cleaning-up after post-processing, I was exploring other configs... Yes, l un-commented all settings e.g.

raport=7878

ok! will added the 'hashes' back ;o) and will have a look at autoProcessMedia.cfg

zilwah commented 3 years ago

I noticed the [[Radarr]] section in autoProcessMedia.cfg doesn't have the setting "delete_on = 0", could this have been the cause for not cleaning-up the folder?

clinton-hall commented 3 years ago

Ok... don't worry about trying to add the hashes back... Just do

git reset --hard
git pull

That whole hashed section is what allows NZBGet to do the config from the web ui. For SABnzbd it is all through the .cfg.

delete_on is a specific parameter accepted by some SickBeard forks that actually do more clean-up based on this parameter. It is not used by, or available for Radarr.

Due to the nature of Radarr's post processor, nzbToMedia doesn't do any final clean of the download directory, as it expects Radarr to do this. Do you have any logs showing where the script runs and the directory isn't deleted?

zilwah commented 3 years ago

Here's the log from SABnzbd for a completed post-processing (before removing hashes) & temp directory & file left behind.

[14:16:43] [INFO]::MAIN: Loading config from [/share/CACHEDEV1_DATA/.qpkg/nzbToMedia/nzbToMedia/autoProcessMedia.cfg] [14:16:43] [INFO]::MAIN: Python v3.9 will reach end of life in 1430 days. [14:16:43] [INFO]::MAIN: Checking database structure... [14:16:43] [INFO]::MAIN: Checking if git needs an update [14:16:44] [INFO]::MAIN: No update needed [14:16:44] [INFO]::MAIN: nzbToMedia Version:f9dde62762f7ad4fa6a5bfca892af7263a28a3e3 Branch:master (Linux 5.10.60-qnap) [14:16:44] [INFO]::MAIN: ######################################################### [14:16:44] [INFO]::MAIN: ## ..::[nzbToMedia.py]::.. ## [14:16:44] [INFO]::MAIN: ######################################################### [14:16:44] [INFO]::MAIN: Script triggered from SABnzbd Version 3.4.2. [14:16:44] [INFO]::MAIN: Auto-detected SECTION:Radarr [14:16:44] [INFO]::MAIN: Calling Radarr:movies to post-process:movie.2021.1080p.WEB.H264 [14:16:44] [INFO]::MAIN: Attemping imdbID lookup for movie.2021.1080p.WEB.H264 [14:16:44] [INFO]::MAIN: Searching folder and file names for imdbID ... [14:16:44] [INFO]::MAIN: Searching IMDB for imdbID ... [14:16:44] [INFO]::MAIN: Unable to determine imdbID: No api key provided for omdbapi.com. [14:16:45] [INFO]::TRANSCODER: Checking [movie.2021.1080p.WEB.H264.mkv] for corruption, please stand by ... [14:16:45] [INFO]::TRANSCODER: SUCCESS: [movie.2021.1080p.WEB.H264.mkv] has no corruption. [14:16:45] [POSTPROCESS]::RADARR: Starting DownloadedMoviesScan scan for movie.2021.1080p.WEB.H264 [14:16:45] [POSTPROCESS]::RADARR: Checking for status change, please stand by ... [14:17:45] [POSTPROCESS]::RADARR: Checking for status change, please stand by ... [14:17:45] [INFO]::MAIN: The /share/CACHEDEV1_DATA/.qpkg/nzbToMedia/nzbToMedia/nzbToRadarr.py script completed successfully. Changing to directory: /share/CACHEDEV1_DATA/.qpkg/nzbToMedia/nzbToMedia

-- Cleaning bytecode -- b'Removing pycache/\n' b'Removing pycache/\n'

-- Cleaning folders: ['libs', 'core'] -- No folders to clean

Returning to directory: /share/CACHEDEV1_DATA/.qpkg/SABnzbd/SABnzbd

-- Cleanup finished --

Radarr: Successfully post-processed movie.2021.1080p.WEB.H264!

clinton-hall commented 3 years ago

ok. was there anything in Radarr logs from 14:16:45? check Debug logs too...

zilwah commented 3 years ago

ok! I think it's either a bug or limitation in Radarr.

with the setting "Remove imported downloads from download client history" enabled, the temp folder is removed (but also the download history in SABnzbd !!)

2021-11-10 19:27:33.5|Debug|SabnzbdProxy|Url: http://192.168.0.48:8900/api?mode=queue&start=0&limit=0&apikey=(removed)&output=json 2021-11-10 19:27:33.5|Debug|Sabnzbd|[....2021.1080p.BDRip.X264.DTS] Deleting folder '/share/Download/complete/....2021.1080p.BDRip.X264.DTS/'. 2021-11-10 19:27:33.5|Debug|SabnzbdProxy|Url: http://192.168.0.48:8900/api?mode=history&name=delete&del_files=1&value=SABnzbd_nzo_j2p_9c28&apikey=(removed)&output=json

when the above setting is disabled the "Deleting folder" step is skipped.

2021-11-10 20:38:10.9|Debug|SabnzbdProxy|Url: http://192.168.0.48:8900/api?mode=queue&start=0&limit=0&apikey=(removed)&output=json 2021-11-10 20:38:10.9|Debug|SabnzbdProxy|Url: http://192.168.0.48:8900/api?mode=history&start=0&limit=60&category=movies&apikey=(removed)&output=json

Thanks heaps, not an nzbToMedia problem by the looks of it.