Page 1 of 1
Scripting n00b...
Posted: March 25th, 2009, 4:46 pm
by undershot
Hi. I've previously made a couple of bash scripts on my mac to process TV and Movie downloads, but I've recently bought an EeeBox PC to run some windows only programs and have in turn decided to run SABnzbd+ on it, to free up other computers in the house. The EeeBox may even eventually become my media player in the living room
.
The problem that I have is that the scripts I originally made in Mac OS X with bash don't work on XP. I would somehow like to convert my TV script from bash to cmd/batch? (new to windows scripting), and at the same time, begin to get an understanding of a windows language, so I can continue customising.
My TV script is simple, but has been effective on my mac, and is shown below in bash:
Code: Select all
#!/bin/sh
FOLDER_PATH="$1"
cd "$FOLDER_PATH"
FOLDER_NAME=`echo $FOLDER_PATH | awk -F [/] '{print $NF}'`
echo "\n\nChecking for .avi file..."
if [ -e *.avi ]
then
echo "\n\n$FOLDER_NAME.avi found and copied into relevant TV folder."
cp *.avi "../$FOLDER_NAME.avi"
rm -rf "$FOLDER_PATH"
else
echo "\n\n\tNo .avi file found, left in SABnzbd+ directory."
fi
echo "\n\n...Processing Complete!"
Could somebody please give me an idea on how I'd go about converting this, or actually do it for me, and from that I'll have a reference file to work with.
Cheers.
Re: Scripting n00b...
Posted: April 3rd, 2009, 2:13 am
by shadow
Save yourself the trouble, install cygwin.
Re: Scripting n00b...
Posted: April 3rd, 2009, 1:41 pm
by BennyHogan
Hey Undershot,
Anyway you could read my post about MacOSX applescripts?? I think you may have something similar to what I need, but I'm a scripting n00b.
Relevant part of my post:
I'd like to have something setup where I can use SABnzbd in automator or an applescript. I think it would be cool if I could set it up to so once its completed and uncompressed by SAB it could tell where on my HD to file it away and reformat the name.......i.e. say I downloaded Season 1 Ep 4 of How I met your Mother and it automatically is converted to How I Met Your Mother S01Ep04 (or something like that) and placed on my external HD under TV Shows/How I Met Your Mother/Season 1/Ep 4.....and then have the original .avi file on the HD deleted so only the stored copy on the external remains.
Surely someone has to have something like this setup??? Any ideas
Thanks in advance
Re: Scripting n00b...
Posted: April 3rd, 2009, 1:43 pm
by BennyHogan
Edit
Re: Scripting n00b...
Posted: April 3rd, 2009, 5:41 pm
by markus101
BennyHogan wrote:
Hey Undershot,
Anyway you could read my post about MacOSX applescripts?? I think you may have something similar to what I need, but I'm a scripting n00b.
Relevant part of my post:
I'd like to have something setup where I can use SABnzbd in automator or an applescript. I think it would be cool if I could set it up to so once its completed and uncompressed by SAB it could tell where on my HD to file it away and reformat the name.......i.e. say I downloaded Season 1 Ep 4 of How I met your Mother and it automatically is converted to How I Met Your Mother S01Ep04 (or something like that) and placed on my external HD under TV Shows/How I Met Your Mother/Season 1/Ep 4.....and then have the original .avi file on the HD deleted so only the stored copy on the external remains.
Surely someone has to have something like this setup??? Any ideas
Thanks in advance
That's all done within SABnzbd with the Renaming for TV shows and using Categories. Just point the TV category to your external drive and enable the renaming portion of it and you should be golden.
Re: Scripting n00b...
Posted: April 3rd, 2009, 6:27 pm
by BennyHogan
markus101 wrote:
BennyHogan wrote:
Hey Undershot,
Anyway you could read my post about MacOSX applescripts?? I think you may have something similar to what I need, but I'm a scripting n00b.
Relevant part of my post:
I'd like to have something setup where I can use SABnzbd in automator or an applescript. I think it would be cool if I could set it up to so once its completed and uncompressed by SAB it could tell where on my HD to file it away and reformat the name.......i.e. say I downloaded Season 1 Ep 4 of How I met your Mother and it automatically is converted to How I Met Your Mother S01Ep04 (or something like that) and placed on my external HD under TV Shows/How I Met Your Mother/Season 1/Ep 4.....and then have the original .avi file on the HD deleted so only the stored copy on the external remains.
Surely someone has to have something like this setup??? Any ideas
Thanks in advance
That's all done within SABnzbd with the Renaming for TV shows and using Categories. Just point the TV category to your external drive and enable the renaming portion of it and you should be golden.
I see the options in SABnzbd but how do I have it determine whether its a TV show or Movie without manually clicking on SAB and telling it which one it is while its downloading?? In the folder I download on my external drive I have both tv shows and movies.
I have SAB set up to enable tv sorting but I don't really know how to get it to be automatically placed in the correct folder because without manually clicking that its tv or move because without doing that it is saved in the root folder and never moved to the correct folder??
Thanks
Re: Scripting n00b...
Posted: April 9th, 2009, 11:11 am
by BennyHogan
bump
Re: Scripting n00b...
Posted: April 9th, 2009, 4:08 pm
by switch
How do you add nzb's to SABnzbd? The watched folder supports categories by creating extra folders for each category, see the Watched Folder section of
http://sabnzbd.wikidot.com/configure-directories