Auto Rename, Name expand

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
D3ltoroxp
Newbie
Newbie
Posts: 9
Joined: December 8th, 2011, 10:31 am

Auto Rename, Name expand

Post by D3ltoroxp »

Hello Community,

i need your help. I will make me a script that makes the following...

For example. SabNZB rename the file to this Lost-S02E05.avi

Now i will that SabNZB write this "SDTV" in the Filename like this :: Lost-S02E05.SDTV.avi

But only for the Series Lost.
For another Serie for example HDTV, SDRIP and so on.

Is this feasible with such a script ?
I imagine it like this.

I make a categorie with Series SDTV and there is tha script that add SDTV to the filename and so on for the other things...

Greet's D3
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Auto Rename, Name expand

Post by sander »

Yes, that's possible.

With the info from http://wiki.sabnzbd.org/user-scripts , it could be something like this pseudo-code:

for all files in $1 and its subdirectories:
if file = *.avi:
extension = extension(file)
basename = basename(file)
newname = basename + SDTV + extention
rename file to newname


It depends on the operating system you use (Linux, Mac, or Windows) what the script looks like exactly. See http://forums.sabnzbd.org/viewtopic.php?f=9&t=9556 for an example of a Linux script.
I found some nice bash script on http://liquidat.wordpress.com/2007/09/2 ... ll-script/

for file in *.$1; do
mv $file `basename $file $1`.$2
done

You could call the above script with '<script> avi SDTV.avi'. Just one script for all renaming ... beautiful! Note: the aboven $1 and $2 are other parameters than the $1 etc from SABnzbd.

I have no Windows, so I can't help you there. Oh, wait: looks easy: http://www.addictivetips.com/windows-ti ... n-windows/ So "ren *.jpg *.jpg" would be "ren *.avi *.SDTV.avi" in your case. So, complete script:

cd $1
ren *.avi *.SDTV.avi
D3ltoroxp
Newbie
Newbie
Posts: 9
Joined: December 8th, 2011, 10:31 am

Re: Auto Rename, Name expand

Post by D3ltoroxp »

Many thanks to you. But I can therefore create a script ? I have no plan ? Is that all what my script needed ? What kind of file extension is needed ?
Post Reply