Page 1 of 2

renaming TV shows with obfuscated filenames

Posted: March 22nd, 2018, 9:43 am
by druftiacto
Hi,

I'm running SABnzbd 2.3.0 on DSM 6 on a Synology. I've recently discovered on this forum that sorting can be used to rename obfuscated filenames to a sensible filename based on the nzb name. I use this for TV shows now and this covers about 80% of these filenames.

However, some groups insist on naming show nzbs with a date, like "My.Show.2018.0102". So far, these shows are not affected by the sorting. Is this when Date Sorting comes into play? And can that be used in conjunction with TV Sorting? Maybe I'm asking the obvious, but I'm not really sure how this works.

Cheers,
druftiacto

Edit: I run SABnzbd 2.3.1, not 2.3.0

Re: renaming TV shows with obfuscated filenames

Posted: March 22nd, 2018, 10:13 am
by druftiacto
I tried to update my previous post, but the edit got refused: "New users cannot post links". I'm sure I didn't post a link, so I don't know what to do.

Re: renaming TV shows with obfuscated filenames

Posted: March 22nd, 2018, 10:13 am
by druftiacto
Update- Looking into it, I really don't understand why some of my shows, named like "My.Show.yyyy.mm.dd" are not renamed. Because I just use "%dn.%ext" as a pattern, so SABnzbd doesn't need to "understand " of what parts the name consists. So I really don't understand why the resultant file is called "a8f97237d6c540c4844d14525166425a.mkv". Or could that have something to do with the fact that there is also a par2 file with the same obfuscated name in that directory? I'm stumped (but still happy that I don't have to manually rename 80 % of the files ).

Re: renaming TV shows with obfuscated filenames

Posted: March 22nd, 2018, 10:19 am
by safihre
You indeed should use the pattern:
%dn.%ext

But also make sure to enable the specific sorting method for the right category and to enable the sorting in general.

Re: renaming TV shows with obfuscated filenames

Posted: March 22nd, 2018, 10:57 am
by druftiacto
Thanks, @safihre. I have sorting enabled for TV shows, and it works fine, except for one show of which the episodes are named as "My.Show.yyyy.mm.dd". I don't know if that's a coincidence, but that's the only common denominator i see for failing renames.
(The download is the right category as it gets this from SickRage and the files end up in the TV folder. )

Any idea why the renaming doesn't seem to work for these shows? Or how I can debug this? (I've looked at the log, but so far I don't see a difference between how files are dealt with).

Re: renaming TV shows with obfuscated filenames

Posted: March 22nd, 2018, 12:17 pm
by druftiacto
Update: i tried to use the same pattern ("%dn.%ext") for Date Sorting. However, now the resulting file is named "09n.mkv". Which makes sense, as %d supposedly stands for the day and this show was, indeed, from the nineth. In the sabnzbd wiki, this pattern, "%dn.%ext", is mentioned under Date Sorting, but could it be that the help is just pasted from TV Sorting? ???

druftiacto

Re: renaming TV shows with obfuscated filenames

Posted: March 22nd, 2018, 12:53 pm
by safihre
You will need a newer version of SABnzbd for this, I think it was at least 2.3.1.
That one should be available from SynoCommunity or from the docker, whichever one you use.

Re: renaming TV shows with obfuscated filenames

Posted: March 22nd, 2018, 1:18 pm
by druftiacto
Thanks, @safihre. I've been looking at the code for 2.3.2 and I see this problem has now been, uh... sorted (sorry for the wordplay... ;D ).

I DO use sabnzbd 2.3.1 which is, I think, the latest package offered by Synocommunity, but which still has the bug that "%dn" is notinterpreted as the dir name.

I read a message on the Dutch synology forum that package creators have a hard time updating packages for DSM 6.0 and later, so that might be a reason we still have to wait. A pity, considering that your work on this is from last year! Thanks for your great efforts,

Cheers,
druftiacto

Re: renaming TV shows with obfuscated filenames

Posted: March 22nd, 2018, 1:36 pm
by safihre
I am also working with SynoCommunity on the new packages.
It's getting very close to a next release now.

Re: renaming TV shows with obfuscated filenames

Posted: December 1st, 2018, 12:50 pm
by jrtwynam
Hi,

I'm having a similar problem. Many of the files I download have obfuscated filenames, and I'd like to somehow automatically rename them using the nzb file name. I'm using SAB version 2.3.5 on Windows 7, along with Sonarr and Couch Potato. Sonarr seems to rename stuff fine, but Couch Potato doesn't. No matter what I do, I haven't been able to get its renamer to work, so I'd like to have SABnzbd do it for me. I've read a bunch of stuff that suggests using the Date Renamer, and I have that enabled for my movies category using %dn.%ext as the sort string, but no luck. My other thought was to add something to the end of my post processing script to do the rename, but I'm not sure how that'd work.

Quite often, a download includes multiple files - the actual movie file, maybe an sfv file, maybe a couple of jpg files (cover art, etc), maybe an nfo file, etc. My script deletes everything with certain extensions, so in theory the only remaining file after that's done will be the movie file. I had thought of simply renaming all files to the nzb filename (with the original file extension), but how would that work with direct unpack? It unpacks directly to my movie download folder as it's downloading, and that folder may contain other files that have previously downloaded and I haven't organized yet. So somehow I need to be able to get the script to recognize only the file(s) in the target folder that were actually downloaded by that particular nzb file.

Maybe I'm making this far more complicated than it needs to be. Any help would be appreciated.

Thanks.

Re: renaming TV shows with obfuscated filenames

Posted: December 2nd, 2018, 1:19 pm
by safihre
What you want can be done using Deobfuscate.py script that's include in the scripts folder of the sabnzbd installation.
Just set it as a post processing script :)

Re: renaming TV shows with obfuscated filenames

Posted: February 3rd, 2019, 5:44 pm
by NZBeaner
safihre wrote: December 2nd, 2018, 1:19 pm What you want can be done using Deobfuscate.py script that's include in the scripts folder of the sabnzbd installation.
Just set it as a post processing script :)
Running 2.3.7. I see Deobfuscate.py in the install folder, but HOW do I "Just set it as a post processing script"???

Also, where can I get some basic info on using Couch Potato, Sonarr (never even heard of that one... ) Sick Beard, etc?

Used to use Newsleecher, SABNZBD is so much better!

Thanks!

Re: renaming TV shows with obfuscated filenames

Posted: February 4th, 2019, 7:46 am
by safihre
You can set the Script's folder in Config > Folders to be the "scripts" folder inside the install folder. Just use the browse-buttton :)

There's a couple of guides out there to setup Sonarr, and even a couple of Youtube videos.
They probably explain what it does very well :)

Re: renaming TV shows with obfuscated filenames

Posted: February 4th, 2019, 10:58 pm
by NZBeaner
Set the folder containing Deobfuscate.py as the script folder, made no difference at all. File name still obfuscated.

Re: renaming TV shows with obfuscated filenames

Posted: February 5th, 2019, 4:37 am
by safihre
And then you need to set the Deobfuscate.py script as your Post-processing script in Config > Categories. For example for your Default category.