Properly name TV episode files

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.

yeah i guess manual renaming

yeah i guess manual renaming of stuff does take up a lot of precious time

Submitted by marilena (not verified) on Tue, 06/05/2008 - 12:18.
Re: Renaming

I'm not sure whether your comment is trying to be sarcastic, but if it is, try renaming 150 episodes of South Park with proper iTunes tags and tell me how long it took you.

Good luck.
---
Vidi, Vici, Veni.

Submitted by Stavros on Tue, 06/05/2008 - 13:22.
Additional AP attributes

Have you looked at adding additonal metatags? I manually set all the ones your script hits plus the following:
--genre
--contentRating
--year
--album
--artwork
--description

Submitted by Mark (not verified) on Sun, 25/05/2008 - 02:59.
Re: Attributes

Oh, I didn't know that... That's for the next version then, thanks for the suggestion!

Submitted by Stavros on Sun, 25/05/2008 - 10:15.
I've been looking for

I've been looking for something like this for ages! I was even considering doing some legwork and coding it myself, but couldn't be bothered.

There is one issue though: it doesn't work on OS X. Keep getting an error that says

UnboundLocalError: local variable 'new_filename' referenced before assignment

Any ideas?

Submitted by magu (not verified) on Mon, 16/06/2008 - 23:04.
Hmm, that's probably a bug, I

Hmm, that’s probably a bug, I think I fixed it a while ago. Get the latest version from the bzr repository from its Launchpad page.

Submitted by Stavros on Mon, 16/06/2008 - 23:37.
Ebooks

I'd love to have a script like this for my e-books, some websites, especially project Gutenberg don't name the files properly and I've renaming some of them for awhile now but it takes so long. You know of any?

Submitted by Anonymous (not verified) on Wed, 29/10/2008 - 00:07.
Missing Beautiful Soup Library module

With the new version of Python [for windows at least] the Beautiful Soup Python script is not included with base install. In order for this Episode Renamer script to work you need this additional library as episode-renamer.py makes import calls from it.

For anyone having trouble here is the link you need in addition... Put these files in the same folder as the episode renamer script before you run it.

Beautiful Soup Python Script:
http://www.crummy.com/software/BeautifulSoup/

Submitted by Anonymous (not verified) on Thu, 12/03/2009 - 20:30.
FileBot TV renamer

Try FileBot, it's the ultimate tv renamer:
http://filebot.sourceforge.net

Submitted by Anonymous (not verified) on Mon, 26/10/2009 - 17:53.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Ads