Page 1 of 1

Automagic file renaming

Posted: February 10th, 2015, 7:40 pm
by Usenet
I'm trying to write a script similar to https://gist.github.com/pleo1/5793049 (but using SAB) that renames files in a nzb based on the "real" name provided in SABnzbd.
However, when I create a new nzb it seems as if SAB is reading the subject when fetching the first article and renames it back to the "fake" name... Is there a way to turn this off?

It would be nice if SAB had the ability to rename files similar to the linked method. The extra overhead is just one segment per file.

To get streaming working properly this is in someway needed ...

Re: Automagic file renaming

Posted: February 11th, 2015, 3:33 am
by shypike
What is the "nzbrename" script supposed to accomplish?

SABnzbd can rename files to (parts of) the NZB file name.
You need Sorting for that.
SABnzbd will also pick up meta-data (like titles and episode names) injected by indexers into the NZB.

Re: Automagic file renaming

Posted: February 11th, 2015, 4:41 am
by Usenet
What I try to accomplish is to get the garbled filenames to real names, sort them, find the first archive file (e.g. rar) and then stream it's content.
What I have done so far is to generate a minimal NZB with just one segment for each file + the full par2 file (based on a "full" NZB). Download this and then find out the real names based on the 16kb hashsum.
Next I generate a new NZB based on the first full NZB but where I have changed the subject to the real filename and also the order in the NZB xml.
" fjafhakfjh [1/77] "ggggg.10" ...." -> " fjafhakfjh [1/77] "playme.rar" ...."
When downloading everything looks good until SAB fetches the first article of the file and suddenly it's renamed back to the old name (guess this depends on if the subject in the nzb matches the server or ?).

Re: Automagic file renaming

Posted: February 11th, 2015, 7:54 am
by shypike
Downloaded files are named as specified in the yEnc records.
So it doesn't matter how they are named in the NZB.
SABnzbd renaming only occurs after unpacking.

Re: Automagic file renaming

Posted: February 11th, 2015, 9:15 am
by Usenet
Ok, that explains the behavior. Guess I'll have to rename the files when each are downloaded.
Thanks for the explanation.