Sabnzbd naming option
Sabnzbd naming option
Hi thanks for the best usenet downloading software
I would like to see an extra naming option in sabnzbd
Replace spaces with dots
I am using and the renaming function and have my library named like ex:
Movie.Name.2011.720P-Group.mkv
Most nzbs will get named this way but some contains spaces instead in there folder names. Sab will then replace the spaces with underscore if checked, i would like it to replace it with dots instead to keep my naming standard.
Hope to see this added sometime. Keep upp the good work
Best regards
I would like to see an extra naming option in sabnzbd
Replace spaces with dots
I am using and the renaming function and have my library named like ex:
Movie.Name.2011.720P-Group.mkv
Most nzbs will get named this way but some contains spaces instead in there folder names. Sab will then replace the spaces with underscore if checked, i would like it to replace it with dots instead to keep my naming standard.
Hope to see this added sometime. Keep upp the good work
Best regards
Re: Sabnzbd naming option
Work-around:
First select the option "Replace spaces with underscores".
Put the following in a file called makedots.cmd and put it in the scripts folder.
Then select the script for the default category.
First select the option "Replace spaces with underscores".
Put the following in a file called makedots.cmd and put it in the scripts folder.
Then select the script for the default category.
Code: Select all
@echo off
cd %1
cd ..
set newname=%3
set newname=%newname:_=.%
if not %3 == %newname% ren %3 %newname%
Re: Sabnzbd naming option
Hi shypike thanks for helping.
I tried your script but i get an warning and it does not seem to work im afraid.
Im running sabnzbd on my nas device linux based. When the extension is .cmd i can see it in the dropdown list but clicking save does not save the selected script. I renamed it with .py extension since the other scripts are named that way. Then i can save the selected script in my movie catagory but when an movie is done and script is executed i get an error:
After checking the faq i found here http://wiki.sabnzbd.org/user-scripts
Any help is mutch appriciated.
I tried your script but i get an warning and it does not seem to work im afraid.
Im running sabnzbd on my nas device linux based. When the extension is .cmd i can see it in the dropdown list but clicking save does not save the selected script. I renamed it with .py extension since the other scripts are named that way. Then i can save the selected script in my movie catagory but when an movie is done and script is executed i get an error:
Im also using sickbeard thats why the default script dir is pointing to sickbeard folder.Cannot run script /share/MD0_DATA/.qpkg/SickBeard/autoProcessTV/makedots.py
After checking the faq i found here http://wiki.sabnzbd.org/user-scripts
I tried changing to $1 in the start of the script since im on linux but it did not help. Seems im stuckedThe script will receive these parameters. Use %1 in Windows scripts and $1 in Unix scripts.
Any help is mutch appriciated.
Re: Sabnzbd naming option
It would have helped if you told me what operating system you are using.
Usually only Windows users think that there are no other OSses in the world.
The worst thing you can do is name it .py, because it's not a Python script.
This is a Python script to accomplish the same thing
Usually only Windows users think that there are no other OSses in the world.
The worst thing you can do is name it .py, because it's not a Python script.
This is a Python script to accomplish the same thing
Code: Select all
import sys
import os
os.chdir(sys.argv[1])
os.chdir('..')
os.rename(sys.argv[3], sys.argv[3].replace('_', '.'))
Re: Sabnzbd naming option
Hi sorry my bad beeing unclear on that.
I am running sabnzbd 0.6.0 on my Qnap nas.
I renamed the file to "makedots.py" and chmod +x the script containing
I moved the script catalog to be sure to "/share/MD0_DATA/.qpkg/SABnzbdplus"
I can select the script for my movies catagory and save. When an movie is done i still get an error
When i check i see even do the script has an failed status the movie get extraced to an dir and got "." dots instead of "_" but it got one extra folder and the .avi filename does contain spaces.
Movie.Name.2011.720P-GRP/grpdirname-moviename720p/Movie Name 2011 720P GRP.avi
So the first dir does look correct but the second level dir should not be there. The movie should be direct in the root of the first folder and also have it's spaces removed.
Movie.Name.2011.720P-GRP/Movie.Name.2011.720P-GRP.avi
Since i dont know anything about python scripting i cant fix it myself. But now it atleast run even do reported with errors.
Your help is mutch appriciated.
Best regards.
I am running sabnzbd 0.6.0 on my Qnap nas.
I renamed the file to "makedots.py" and chmod +x the script containing
Code: Select all
import sys
import os
os.chdir(sys.argv[1])
os.chdir('..')
os.rename(sys.argv[3], sys.argv[3].replace('_', '.'))
I can select the script for my movies catagory and save. When an movie is done i still get an error
Cannot run script /share/MD0_DATA/.qpkg/SABnzbdplus/makedots.py
When i check i see even do the script has an failed status the movie get extraced to an dir and got "." dots instead of "_" but it got one extra folder and the .avi filename does contain spaces.
Movie.Name.2011.720P-GRP/grpdirname-moviename720p/Movie Name 2011 720P GRP.avi
So the first dir does look correct but the second level dir should not be there. The movie should be direct in the root of the first folder and also have it's spaces removed.
Movie.Name.2011.720P-GRP/Movie.Name.2011.720P-GRP.avi
Since i dont know anything about python scripting i cant fix it myself. But now it atleast run even do reported with errors.
Your help is mutch appriciated.
Best regards.
Re: Sabnzbd naming option
Right. I forgot one important thing.
The script must start with:
!/usr/bin/python
That is assuming that Python is actually in /usr/bin, you may want to check that.
The script only replaces stuff in the folder name.
If you want more, refer to the Sorting options, which contain some more options in that area.
I'm not going to write your script for you.
The script must start with:
!/usr/bin/python
That is assuming that Python is actually in /usr/bin, you may want to check that.
The script only replaces stuff in the folder name.
If you want more, refer to the Sorting options, which contain some more options in that area.
I'm not going to write your script for you.
Re: Sabnzbd naming option
The script works it renames the folder correct
Now my only problem is to be able to run it without getting an the error message in sabnzbd evertime, even do it works. Will try my way from here.
Thanks for your help, hat of for you mate.
Best regards.
Now my only problem is to be able to run it without getting an the error message in sabnzbd evertime, even do it works. Will try my way from here.
Thanks for your help, hat of for you mate.
Best regards.
Re: Sabnzbd naming option
What kind of error message?onlyalex wrote:without getting an the error message in sabnzbd evertime, even do it works.
Re: Sabnzbd naming option
Hi sorry for late reply
Il get this error message
My python directory differs from your example and i have this in the start of the script
Il get this error message
The script still runs do, the folder is renamed as it should but i see the error message on the right side of the main download window.Cannot run script /share/MD0_DATA/.qpkg/SABnzbdplus/rename_folder2.py
My python directory differs from your example and i have this in the start of the script
Is there any loggin i can access maby to see why it says it fails even do it dont :S!/share/MD0_DATA/.qpkg/Python
Re: Sabnzbd naming option
Does it actually run or not?
If it does and you still get an error message, it may be that the script doesn't return
an exit code of 0 as nice script are supposed to do.
End your script with an "exit 0" line.
If it does and you still get an error message, it may be that the script doesn't return
an exit code of 0 as nice script are supposed to do.
End your script with an "exit 0" line.
Re: Sabnzbd naming option
Python is an ipkg in this case. So it lives in /opt/bin, and as we are using python2.6, without renaming or symlinking it to python (as other qpkg's tend to use other versions of python) the line should read:shypike wrote:Right. I forgot one important thing.
The script must start with:
!/usr/bin/python
That is assuming that Python is actually in /usr/bin, you may want to check that.
The script only replaces stuff in the folder name.
If you want more, refer to the Sorting options, which contain some more options in that area.
I'm not going to write your script for you.
!/opt/bin/python2.6
cheers
Re: Sabnzbd naming option
Hi i take this upp again since i have not manage to get it working. Sometime i managed to get the namin fuction work, i thought but i realised i used another .nzb file where the naming was already right.
I have redone my test with a valid .nzb file. Adding it to the que will for sure download an movie with Movie_Name etc.
I edited the script accordingly but did not make this work.
The script does not rename the output folder and exits with an error code as stated before. Im giving up on this and thank you all for your help.
Im hoping this feature can be implemented in sabnzbd webinterface as an option in a near future.
Best regards.
I have redone my test with a valid .nzb file. Adding it to the que will for sure download an movie with Movie_Name etc.
I edited the script accordingly but did not make this work.
Code: Select all
!/opt/bin/python2.6
import sys
import os
os.chdir(sys.argv[1])
os.chdir('..')
os.rename(sys.argv[3], sys.argv[3].replace('_', '.'))
exit 0
Im hoping this feature can be implemented in sabnzbd webinterface as an option in a near future.
Best regards.
Re: Sabnzbd naming option
Did you test the script separately, so that you can see the actual error message?
Re: Sabnzbd naming option
I'm running Mac OS X Lion and would love to know the script code for renaming the underscores into decimals/dots also. Thanks in advance!
-
- Newbie
- Posts: 1
- Joined: December 6th, 2011, 4:30 am
Re: Sabnzbd naming option
oh man, I'm also looking for that same script code, If someone out there has that code please share here or PM me as soon as possible.