Page 1 of 2

SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: April 4th, 2010, 7:12 pm
by DigitalDetritus
Hey guys. I used to use NZB-TV to auto-download television shows using Newzbin, but since it's gone down for that, I

switched to using TVNZBRSS.com to download shows automatically via RSS using SABnzbd. However, the names are all messed

up, since it has things like Show.Name.S03E01.XviD.whatevergroup.avi and things like that.

I wrote a program that can be used as a script in SABnzbd to automatically query TVRage for the appropriate episode

title and name the show and put it in folders according to user naming preferences (I use the same conventions as

SABnzbd). I wrote a lot of documentation too and set up a UserVoice site for feature requests and problem reports.

I'd love to get a few more people trying it out to give me feedback.

The product page is here:
http://digitaldetritus.tumblr.com/tvrenamer

Here's my executive overview from that page:
The SABnzbd Automatic TV Renamer is the buddy of your SABnzbd installation if you download television shows. It takes

the scene names like show.name.s03e08.xvid.avi and turns them into friendly folder and file names like “Show Name

\Season 3\Show Name - 3x08 - Episode Title.avi”. These names are controlled by user settings (refer to the

documentation below) and are fully customizable.

Features:
Queries TVRage for correct show titles, episode titles, season and episode numbers, and air dates
Auto-detects dates and season/episode numbers from scene releases like this:
show.name.s03e08.xvid.avi
show name 3x08 something.avi
show.name.2010.01.02.xvid.avi
show name 2010-01-02 xvid.avi

Renames files/folders according to user preferences
Integrates directly with SABnzbd and requires no user interaction after setup.

I think it's pretty neat and it should work fine with any RSS provider with scene names (I'm using tvnzbrss.com which

is using tvnzb.com). I'd love to expand it to a wider audience and get feedback.

I've included a lot of documentation (which we developers hate to write).

If you try it out, let me know what you think by leaving a comment on a post on the blog, or if you have a problem or

feature request, just click the bright red "feedback" on the web page.

Again, the product page is here:
http://digitaldetritus.tumblr.com/tvrenamer

Thanks,
DigitalDetritus

Re: SABnzbd Automatic TV Renamer

Posted: April 8th, 2010, 11:17 pm
by ugokanain
With the current status of NB, the naming of files has gone haywire. One of the really nice things about NB is its editors, who managed to name files in a consistent fashion. Grabbing nzbs from other sites implies that these won't be renamed correctly, nor the duplication prevention works.

Currently tv episodes get renamed, but they don't grab the show name. Since duplication prevention doesn't work one way or another I have downloaded the same episode multiple times.  Not sure about movies.

Any chance that sab could check the names at tvrage or another show site?

Re: SABnzbd Automatic TV Renamer

Posted: April 11th, 2010, 8:35 pm
by DigitalDetritus
ugokanain, I'm not sure if I follow. The whole point of this program is to take scene releases and rename the show and episode titles based on your preferences and by querying TV Rage to get the correct information. All of this happens automatically. You are correct about the duplicates. This has to be handled by the RSS feed (not something that somebody else couldn't do). It's also possible to add this to my program in the future. If you or anyone else would like that, please submit that on the feedback page.
ugokanain wrote: With the current status of NB, the naming of files has gone haywire. One of the really nice things about NB is its editors, who managed to name files in a consistent fashion. Grabbing nzbs from other sites implies that these won't be renamed correctly, nor the duplication prevention works.

Currently tv episodes get renamed, but they don't grab the show name. Since duplication prevention doesn't work one way or another I have downloaded the same episode multiple times.  Not sure about movies.

Any chance that sab could check the names at tvrage or another show site?

Re: SABnzbd Automatic TV Renamer

Posted: April 11th, 2010, 8:38 pm
by DigitalDetritus
I just posted version 1.2.0.0. It's a big release, which now includes Linux support and update notification!

Read more over on the blog post (and then check the changelog).

1.2.0.0:
Added auto-update mechanism (checks external site and notifies user in script output.

Totally refactored the internal workings of the workflow to make the code easier to modify and also to allow more unit testing (there are now 60 unit tests for the entire project). What that means for you the user:

The code is far less likely to have significant bugs and less likely for regressions to occur as they will be immediately caught before deploying a new version.

Added Linux support! Had reworked the workflow to use Microsoft’s Windows Workflow Foundation, but Mono has incomplete support for it. Wrote a custom workflow to allow for Mono to work on Linux/Mac. Tested on Ubuntu 9.10, which has Mono built in, and it works great.

This may allow the software to work on Mac as well, but I do not have a Mac on which to test the software.

User can test TV Rage and the parsing algorithm by using the /test command line parameter (e.g. TvRenamer.exe /test)

1.1.2.0:
Convert forward slashes (/) to backslashes (\) in patterns, because users converting from SABnzbd’s patterns may have forward slashes, but Windows does not support this as a path separator. Per user request.

Added default feature to update directory write times to show a file in the folder or one of the sub-folders has been updated. Will help in sorting by modified date by folder. Per user request.

Re: SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: April 12th, 2010, 3:25 pm
by KaiUno
Great stuff dude! It works for me for the most part, but that's probably because I skipped reading the readme... for the mostpart. It does the renmaing just fine though, it only puts the downloads in some completely unexpected folder. No worries though, I got a nice error log to poke around in and see what's what!

Keep it up. This could alleviate NewsBin withdrawal I'm currently experiencing. (Now let's get this thing integrated into SABnzbd, together with an option for movies.)

Re: SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: April 12th, 2010, 6:19 pm
by DigitalDetritus
I know it's a lot to read, but at least read section 7. It details what every setting is in the config. The one in particular you're having trouble with is "FinalDownloadRoot", but do read the rest of section 7.

Thanks for the feedback.
KaiUno wrote: Great stuff dude! It works for me for the most part, but that's probably because I skipped reading the readme... for the mostpart. It does the renmaing just fine though, it only puts the downloads in some completely unexpected folder. No worries though, I got a nice error log to poke around in and see what's what!

Keep it up. This could alleviate NewsBin withdrawal I'm currently experiencing. (Now let's get this thing integrated into SABnzbd, together with an option for movies.)

Re: SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: April 13th, 2010, 1:37 am
by KaiUno
Hehe, don't worry about it, wasn't really asking for support. Got it working though. The whole "sab downloads to temp", "script works from temp to another folder" concept didn't click right away. Again, great stuff!

Re: SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: April 15th, 2010, 5:33 am
by slenderlittleone
Hi,

        thank you for your suggestion

Re: SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: April 17th, 2010, 6:33 am
by dukevim
Hi, I would like to get this to work in OSX, I have installed Mono and I can make the script run from the terminal, with this command :

mono TvRenamer.exe

but I don't know how to call it from within Sab+

I'm guessing you don't have a Mac to test it on, but any suggestions?

Re: SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: April 22nd, 2010, 9:26 am
by teriaki
Just wanted to say thanks for this.  It's working great and I really appreciate the effort.

I think there is an error in the configuration file you supply.  Line 19 simply has "".  I believe you want to have it read "" to allow the user to customize the parameter ReplaceInvalidCharactersWith.  Without this change mono gets very angry indeed :D

Thanks again!  Really great stuff for us NZB withdrawal folks!

Re: SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: April 23rd, 2010, 5:56 pm
by DigitalDetritus
dukevim wrote: Hi, I would like to get this to work in OSX, I have installed Mono and I can make the script run from the terminal, with this command :

mono TvRenamer.exe

but I don't know how to call it from within Sab+

I'm guessing you don't have a Mac to test it on, but any suggestions?
Duke, it sounds like Teriaki above might be a little better suited to help you as I don't have a mac. However, I'd think it would be as simple as putting the following in a script like runrenamer.sh

#!/bin/sh
cd /path/where/tvrenamer/lives
mono TvRenamer.exe $1 $2 $3 $4 $5 $6 $7

then set the script to executable like this: chmod +x runrenamer.sh

Make sure that .sh file is in your scripts directory and set sabnzbd to run it instead. I don't know if any of that will work at all, and I can't support it without a Mac, but give it a whirl. Ask Teriaki as well, since he/she seems to be using it on Mac OS.

Re: SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: April 23rd, 2010, 5:59 pm
by DigitalDetritus
teriaki wrote: Just wanted to say thanks for this.  It's working great and I really appreciate the effort.

I think there is an error in the configuration file you supply.  Line 19 simply has "".  I believe you want to have it read "" to allow the user to customize the parameter ReplaceInvalidCharactersWith.  Without this change mono gets very angry indeed :D

Thanks again!  Really great stuff for us NZB withdrawal folks!
Interesting. should work fine. That means the same thing as an empty string, . Works on Linux under Mono, so I'm not sure why it doesn't work on Mono on OS X. Since my default is an empty string, any time I mess with preferences, Visual Studio is going to set it back to . That is just something Mac users will have to live with, unfortunately, if that doesn't work (setting it to ).

Fortunately, you should NOT replace that file when upgrading, so you shouldn't have to deal with it again.

Nice to hear it's working on Mac though, since I can't test there. Thanks for the feedback.

Re: SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: April 24th, 2010, 9:08 am
by teriaki
I'm actually using Ubuntu and I stand corrected.  I retested by using the packaged config and my paths and it worked out of the box.  My apologies!  I must have had some other error and took it out on you :)

Regarding OSX, I'm going to try and test it there and lend a hand to the poster above.

Re: SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: May 6th, 2010, 7:14 pm
by jeftep
Exellent script. Thank you.

How do I configure it to read a dated show name (Showname.DD.MM.YYYY, etc) and turn it into a Season/Episode format (Showname.sXX.eYY)?

Re: SABnzbd Automatic TV Renamer, now supporting Windows and Linux

Posted: May 28th, 2010, 10:52 am
by rgkc77
Great tool! I use it because I download a release that has the scene name in the front. I use regex to replace it.

I got a question though. I download the nzb via rss. After the unpack the script runs, but it only renames the nzb. It will just copy the rest of the files and folders to the assigned folder. For example I get:
- renamed NZB-file in the Season folder
- subfolder in the Season folder with the mpg with original name and a few other ad files.

Is this normal or did I do something wrong? Can the script only process 1 file?

Thx.