Page 1 of 2

Renaming - One step further

Posted: 26 Apr 2020, 06:49
by DigitaLSD
Forgive me if this is the wrong place, or if this already exists. I just started using NZBGet over SAB, but one of the things I like about SAB was that I could tell it to rename the extracted file to the folder name, and then flatten. I don't see a way to do that within NZBGet, it will rename the folder just fine, but will not rename the extracted file inside of the folder. My fear if I use the "flatten.py" script, is that it will put the file in the main folder without renaming it first, and it will flatten things that need directory structure like BDMV's.

SAB's method avoided both of these possibilities. Is there a way to do this same thing inside of NZBGet?

Re: Renaming - One step further

Posted: 26 Apr 2020, 13:32
by hugbug
To organise downloaded files we have post-processing script VideoSort.

Re: Renaming - One step further

Posted: 26 Apr 2020, 16:22
by DigitaLSD
hey hugbug, thanks for the reply. As I understand it, that will not only rename the files, but move it into my media folders as well, and is intended as a media management solution, right? My issue with something like that is, I run all of my releases through handbrake before they get added to my media library, and I use Sonarr/Radarr to move and rename once Handbrake has finished with them. What I am looking for is something just as simple as Rename obfuscatedfilename.mkv to folderfilename.mkv and then flatten.py can be used after that to remove it from the folder...

Re: Renaming - One step further

Posted: 26 Apr 2020, 16:33
by hugbug
I think if you set MoviesDir empty in VideoSort and MoviesFormat to %dn/%dn.%ext it will just rename the file within original directory.
You should also probably disable option Cleanup in VideoSort.

Re: Renaming - One step further

Posted: 26 Apr 2020, 16:39
by DigitaLSD
Thanks, I will give it a try!

Re: Renaming - One step further

Posted: 27 Apr 2020, 00:15
by DigitaLSD
hugbug, I appreciate the assistance so far... For some reason, no matter what I try, videosort keeps failing, and the file is either getting deleted or moved into the ether somewhere...

ideally, when sab completed, I had Movies in the Completed/Movies dir and TV Shows in the Completed/TV dir. I have tried with:

${DesDir}/Movies
D:/Downloads/Completed/Movies

and I have the MoviesFormat populated as follows %dn.%ext

This, if I understand it correctly, should change the filename of the video to the folder name, and place the file in the /Movies folder and delete the original folder. However, it keeps failing, and both the file and folder are being removed when it fails, prompting Radarr to search and download a new one and marking this one as blacklisted. I don't think this is correct behavior, so I am hoping you may be able to help me figure out what it is I am doing wrong.

Re: Renaming - One step further

Posted: 27 Apr 2020, 00:51
by hugbug
Click on nzb in history, then on button Log. The log should explain what happened.
If you are not sure you can upload the log to pastebin.com and post the link here.

Re: Renaming - One step further

Posted: 27 Apr 2020, 02:28
by DigitaLSD
This is what I get in the log:

Sun Apr 26 11:47:06 2020 INFO VideoSort: C:\Users\****\AppData\Local\Programs\Python\Python37\python.exe: can't open file 'L': [Errno 2] No such file or directory
Sun Apr 26 11:47:06 2020 ERROR Post-process-script VideoSort.py for Releasenamehidden-Obfuscated failed (terminated with unknown status)

Re: Renaming - One step further

Posted: 28 Apr 2020, 13:30
by DigitaLSD
@hugbug Every time it goes it says it cannot find that file 'L' and terminates. I have Python 3.7 and Python 2.7 installed. Any ideas on what could be the issue?

Re: Renaming - One step further

Posted: 28 Apr 2020, 15:35
by hugbug
The python is probably started with incorrect parameters. The command line to execute python is read from registry from file association for py-extension.

Try option "ShellOverride" in NZBGet to associate .py-files with python2-executable instead. I believe VideoSort doesn't work properly with python 3. Anyway it's better to use ShellOverride instead of relying on registry.