Automagic file renaming

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
Usenet
Jr. Member
Jr. Member
Posts: 87
Joined: February 12th, 2008, 6:04 pm

Automagic file renaming

Post 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 ...
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Automagic file renaming

Post 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.
Usenet
Jr. Member
Jr. Member
Posts: 87
Joined: February 12th, 2008, 6:04 pm

Re: Automagic file renaming

Post 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 ?).
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Automagic file renaming

Post 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.
Usenet
Jr. Member
Jr. Member
Posts: 87
Joined: February 12th, 2008, 6:04 pm

Re: Automagic file renaming

Post by Usenet »

Ok, that explains the behavior. Guess I'll have to rename the files when each are downloaded.
Thanks for the explanation.
Post Reply