I've been working on a new version of tvnamer, the utility I discussed in "Automatically rename your torrent'd TV episodes"

It's a pretty much complete rewrite. Some of the new features include:

  • Configuration files. In tvnamer v1 you could only customise things like the output filename format by modifying the Python code directly. Now you can create a JSON file at ~/.tvnamer.json which changes any of the default options.
  • Support for multi-episode files, such as scrubs.s01e23e24.avi
  • Support for anime filenames, such as [Shinsen-Subs] Beet - 19 [24DAB497].mkv
  • Much better UTF-8 filename handling
  • Ability to move files to specific location after renaming (/media/tv/{series name}/season {seasonnumber}/ for example)

It's still very much under development. The main functionality is now pretty much stable, there's a few features I'm still working on. I'm currently implementing the file-moving feature, so while it currently works, it may not be stable..

As it is still under development, currently easy_install tvnamer will install the old version 1. To get the latest version, see the README on Github (ignoring the easy_install part)

You can follow tvnamer v2's progress on github.com/dbr/tvnamer, and report bugs and request features on Lighthouse


I haven't checked the comments on the original post for a while, and was surprised to see about 10 new comments.. I'll reply to them here, as most of the requests are implemented in the tvnamer v2.

Loz: Could this be extended to move files within a directory structure aswell?

Yes, this feature is currently being developed, as mentioned.

Loz I use the command line in Linux allot and as such spaces in my file names are a bit of a pain, as such I added this to your script to allow it to strip spaces from the file names and replace them with underscores.

The custom_replacements feature can do this. The following config ( saved at ~/.tvnamer.json or specified with the --config flag) will replace spaces with underscores in the output filename:

{
    "output_filename_replacements": [
        {"is_regex": false, "match": " ", "replacement": "_"}
    ]
}

Michael Works very well on Snow Leopard--thank you!

I'd hope so! It's primarily developed on OS X Snow Leopard, using the system-installed Python 2.6. It's also tested on Python 2.5

Mike it might be useful to OSX users if the script ignored filenames that begin with '._'

Good point, I've created a ticket for this

James Jarvis Although one suggestion. Is there anyway you could move the config to a .tvrenamer file in our home directory that way when we do an update we don't have to fix it manually each time? Thanks.

Yep, done. As mentioned, you can now change the default options via a JSON config file

Carlo I have only a question. I'm Italian, so I would like to have episodes names in Italian.

In thetvdb.com there are also in italian. So I need only to change language ID from english to Italian.

This is settable via the config file.

{
    "language": "it"
}

..will use Italian episode names data, where available

Loz Secondly are you intrested in testers for this.

Yes, definitely. Best place to report bugs is on tvnamer's Lighthouse project, as I get notified of new tickets, and can reply directly, close tickets as they are fixed and so on..

Although I prefer Lighthouse, it can be a hassle signing up for yet-another-internet-account, so if you have a Github account, feel free to create an issue on it's Github issues page

Cato I am very interessted in getting the move script working. I have tested the autoPathTv script, but I am not using the same naming standard and I am unable to understand how to change from [01x23] to S01E23 or get the tvnamer.move.mod part of the script.

I've not used the autoPathTv command for a while, but you should just change the regexs in filename_config (specifically tv_regex['with_ep_name'])

die hard torrenter So ... that's why there are so many dead torrents out there

Erm, not really. Torrents die because people stop seeding.. It's quite simple to copy the downloaded file to an external drive and run tvnamer on the copied file.. The in-development --move feature will make this even simpler, by having a option to copy the file to another location without touching the original file.