I just encoded my Futurama DVDs to put on my iPod, but it’s a real hassle adding tags to every single file separely, so I created a script to do it for me. I had actually written this before, but I forgot it at home, so I had no option but to rewrite it.

The script (written in Python) will search the filenames for “sXXeXX” and look up the episode name on IMDB, and then will rename the file as “Show name - SXXEXX - Episode name.extension”. If you have AtomicParsley, it can also run it and fill in the tags for iTunes with the proper information automatically.

The script is available at the scripts page, or, if you’re too lazy, here.

To run it, you need to have Python installed (obviously), and run it as ./episode_rename.py <imdb show id>, where “” is the IMDB show ID (surprisingly), as it appears in the URL. For example, for Futurama, the ID is tt0149460.

Hopefully, this will correctly detect all the video files in the current directory and rename them accordingly (this works for any kind of file, really, it’s not picky, so subtitles will also be renamed, as long as they have sXXeXX in the name).

That’s all, really. I hope you enjoy this and do something productive instead of renaming a million episodes manually.