Log in

View Full Version : Looking for a tool that renames files according to imdb-info


((( atom )))
14th June 2009, 18:05
Hi,

I am going nuts trying to find any software that sucessfully renames my movie collection based on imdb-data. When ripping I am mostly lazy, so the files are called TITLE.mkv. Since I have over 700 movies, I don't want to rename them by hand..

What I need is a filename like TITLE (YEAR DIRECTOR).mkv, because I have a script that scans the movie-folder daily and creates links for year and director in other folders for convinient browsing.

I found quite some tools that get imdb-information and display it, but none of these is able to rename my files properly.

Does any one here have a suggestion? I am desperately looking for a solution.

Best regards!

ultimatebilly
29th June 2009, 21:52
Hi ((( atom ))),

I think it will be quite easy to hack something together in Python using this:

http://imdbpy.sourceforge.net/

The websites lists a programm that scans a folder for titles, and displays relevant information for all movies that are found.
I'm very busy at the moment, but if no one else steps in I will wrap something together over the weekend (have exams in 2 weeks, so probably no time for a nice interface and more advanced features than simply copying movies that have an exact match to a new location with an updated filename).

((( atom )))
29th June 2009, 23:55
Hi Ultimatebilly,

meanwhile I figured, that the great xbmc www.xbmc.org is very good for getting all metadata one could dream of and can even be used to browse and play all my movies, EVEN using vdpau under linux! So now I had to change all my movie-titles to TITLE.mkv but I will never need my filenaming-structure again!

So all in all I'm very happy, but thx a lot for the friendly offer, anyway!

ultimatebilly
30th June 2009, 02:28
... EVEN using vdpau under linux!


Nice, I didn't know the Linux port was that far already! :)
I love xbmc on my xbox, really have to try this out soon!
Thanks for reminding me, and I'm glad to hear you found something that works good for you! :)

RunningSkittle
30th June 2009, 06:08
Nice, I didn't know the Linux port was that far already! :)
I love xbmc on my xbox, really have to try this out soon!
Thanks for reminding me, and I'm glad to hear you found something that works good for you! :)

XBMC uses mplayer which implemented it.

((( atom )))
1st July 2009, 16:50
@ultimatebilly: But you know what? Actually it would be very helpfull to have a renamer that can do TITLE (YEAR), because I figured that xbmc gets many titles wrong if they don't have a year in their name.. Still up to it?

ultimatebilly
1st July 2009, 21:57
Sure, I think I will have a few hours in the weekend.

xbmc gets many titles wrong if they don't have a year in their name.. Still up to it?

If xbmc gets the titles wrong because it has difficulties finding the correct movie, a script will have the same problem. I will see if I can include a dialog where you can choose the correct title if several matches are found.
This means I have to create a GUI. I will either try TkInter which is bundled with Python, but which I have no experience with, or use wxPython which I have used before a few times (which means that you have to install that to use the script. Creating a standalone executable is possible, but only worked ok for windows everytime I tried it, and even there not always).
Stay tuned, but don't expect anything until sunday night! ;)

@RunningSkittle:
Ah, of course, I should have thought of that, since even the xbox version of XBMC uses mplayer. Great to see that mplayer once again is on the cutting edge! :)

((( atom )))
2nd July 2009, 13:25
Yeah, the problem also came to my mind, but if you can make a gui to address that, very cool! Man, thx for doing this!

ultimatebilly
5th July 2009, 14:35
No problem! :)
You can find the tool here:

http://bitbucket.org/ultimatebilly/imdb_filerenamer/

It is made with TkInter, which means it is really ugly on Linux! ;)
And compared to wxPython, TkInter is a mess! For me, it feels rather inconsistent, and it isn't easy to find good documentation.
But well, it works, and it seems possible to achieve a lot with it if somebody is willing to do so.
My code is a mess too, unfortunately, because I took more or less a trial&error approach. But for me the tool does what it is supposed to.
It is rather slow, because it does two queries to imdb for each movie, one to fetch the results, and the other do get details about the movie. And it has no feedback except the request if a move should be copied/moved if you don't disable this.
It should be safe to move the files, because it will refuse to overwrite anything. At the moment it just ignores any subdirectories, so your movies have to be in one directory.

Well, just try it, I hope it does what you need!
Just execute check_and_rename.py (has to be executable) or run "python check_and_rename.py".

((( atom )))
9th July 2009, 09:39
Hey, I didn't get a mail, that you replied here, just came by..

Thx a lot, I will try it and let you know, if it worked! Might take till tomorrow, though..

freakk69
9th July 2009, 18:45
HI,ultimatebilly.
How to use this .
I just saved the zip and extracted it but cudn't execute it ..
How to do that?

ultimatebilly
10th July 2009, 23:13
Hi freakk69,

the tool needs Python to be installed.
You can download it from the Python website:

http://www.python.org/download/releases/2.5.4/

Version 3 will not work because there have been a number of backwards incompatible changes.
I personally still use version 2.5.4.
If you are on Windows, you will have to add the path of the python executable to your system path, at least I had to do this the last time I installed Python on Windows. Otherwise one would have to always specify the complete path to the python executable instead of just writing "python".

Just right-click on
My Computer, choose "Properties" --> Advanced --> Environment Variables

Choose the "PATH" variable from your System Variables, click Edit and append ";c:\python25;c:\python25\scripts" without the quotes to the list of paths.
If you now open a terminal, you can just type python, and the interpreter will be started.

I think the Python installer sets a file-association with .py-files, so you should be able to start the tool by just double-clicking the "check_and_rename.py" file.
If this doesn't work, open a command prompt, cd to the directory of the script, and type "python check_and_rename.py".
If you don't want the console to pop up in the background, just change the file extension from .py to .pyw. This way the interpreter won't show the terminal.

((( atom )))
11th July 2009, 19:40
Found some time finally to check it out and it works just fine! - Thank you so very much for this lillte tool, I've been looking for one for years! Greatgreatgreat!

ultimatebilly
13th July 2009, 23:27
Glad you like it! :)
I will release another small script some time after Thursday (after exams), which I use to copy all my DVDs and CDs to my HDD.
It is meant to run in the background, and check the drive every few minutes if a new media is inserted.
If there is a new CD/DVD, it determines the type (VideoDVD, (S)VCD, data), and invokes either rsync or vcdxrip. After handling the media, it ejects the media and waits for the next. The hardest part was to determine if something already has been copied, but I think I sorted that out pretty much.
It works fine for me, maybe it can be useful to others.
Due to the dependency on rsync, vcdxrip and vcd-info (to make it possible to check if a (S)VCD has already been copied) and "beep" (to notify you if something happens), it only works on Linux at the moment.
If there is enough interest, I might make a version for Windows (which I don't use anymore).
The only thing it doesn't detect atm are audio-CDs, I didn't find a way to determine when an audio-CD is inserted.
It just needs some cleaning up (comments are in German for example), when I find some spare time I will put it online.