Movie renaming based upon imdb

Come up with a useful post-processing script? Share it here!
SukkaFoo
Newbie
Newbie
Posts: 8
Joined: September 25th, 2008, 1:51 pm

Movie renaming based upon imdb

Post by SukkaFoo »

Hi all

So I was wondering if there is a script out there which would rename downloaded movies to the proper name, possibly based upon info pulled from IMDB? I have seen something similar on NZBget before (pulls the age rating, year, etc and includes in the name of the file)

Thoughts?
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: Movie renaming based upon imdb

Post by switch »

I do have python code that will fetch the proper name from imdb, I'll see if I can work it into a script next week. 0.5 will rename files based off of the nzb name with support for CD1 CD2 ect, so I could re-use that code for this purpose.
jl0810
Newbie
Newbie
Posts: 18
Joined: December 27th, 2008, 8:01 am

Re: Movie renaming based upon imdb

Post by jl0810 »

Switch - do you happen to have the Python code?  I would LOVE to integrate this into the fantastic scripts that others have been developing on this website (big fan of both the conversion one(s) as well as the automatic downloaders)

Renaming the movies in the last step I have left

(actually to be honest I would really want to rename, and also use atomicparsley to tag some other data as well in the file such as genre, rating etc - I know Metax does this for free, but I don't have a MAC yet)
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: Movie renaming based upon imdb

Post by switch »

I have the imdb searching python code, pretty basic with little error handling. The renaming code is in the 0.5 source code, and may be too hard to separate. Probably best just waiting till 0.5.

If you want to see the renaming, see GenericSorter here.
Camelot
Jr. Member
Jr. Member
Posts: 64
Joined: August 18th, 2008, 6:23 am

Re: Movie renaming based upon imdb

Post by Camelot »

Does anyone know of any python code that can extract any meta data from imdb? I am currently using tagchimp, which often is lacking, and would prefer to use imdb as a source.

Oh, and there is a metax version for windows now:
http://www.danhinsley.com/MetaX.htm

I am a mac user, so I can't vouch for it.
jl0810
Newbie
Newbie
Posts: 18
Joined: December 27th, 2008, 8:01 am

Re: Movie renaming based upon imdb

Post by jl0810 »

I downloaded the MetaX windows version - and while I think it's an ok port, i agree that it's lacking by only tagging with amazon and tagchimp.  Personally I don't think you need anything that fancy to tag these movies, and simple post-processing scripts that writes the tag data (not sure how to do artwork) would be perfect.    I think this forum is probably the place to solve this pesky problem.  I bet doublerat could do it  ;D
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: Movie renaming based upon imdb

Post by switch »

Camelot wrote: Does anyone know of any python code that can extract any meta data from imdb? I am currently using tagchimp, which often is lacking, and would prefer to use imdb as a source.

Oh, and there is a metax version for windows now:
http://www.danhinsley.com/MetaX.htm

I am a mac user, so I can't vouch for it.
What sort of meta data? Plot data and such?
Download my XBMC Plugin and check out the files in the folder imdbAPI, it can retrieve a lot of information. The original file wasn't made by me, but I did do some minor editing. I think the credits are in the readme.
jl0810
Newbie
Newbie
Posts: 18
Joined: December 27th, 2008, 8:01 am

Re: Movie renaming based upon imdb

Post by jl0810 »

that's good stuff there.  If i took imdbclient.py and wanted to mod it to be just a simple post processing script that fired immediately after job downloads, any ideas on what that Python code would look like?  At the point, I believe only have the nzb job name available (or folder name).  I need then to have imdbclient.py look up the meta data, and then I think I can fight through atomicparsley to tag the file with the returned metadata
Camelot
Jr. Member
Jr. Member
Posts: 64
Joined: August 18th, 2008, 6:23 am

Re: Movie renaming based upon imdb

Post by Camelot »

switch: yea, plot, artwork.. the works really :) I will take a look at the plugin!

I have some python scripts here that use a slightly modified version of atomicparsley to tag movies and tv shows based upon their path and filename:
http://github.com/ccjensen

For movies I am using tagchimp (since IMDB doesn't have an API), and thetvdb.com for the tv episodes. They do artwork too.
They are both commandline, and as far as I know I am the only one who has ever used them.
C
pilGrim
Full Member
Full Member
Posts: 116
Joined: January 9th, 2009, 7:28 pm
Location: Hong Kong, SAR China

Re: Movie renaming based upon imdb

Post by pilGrim »

Hi Switch,

For the feature in 0.5 any chance that after a download the code would name the file as well as the folder to the proper movie name?  I use the folder name in Meedio and need it to be the proper movie name, otherwise I have post download manual work to do.

Also any I would greatly appreciate the ability or some code share that would allow me to process existing files.  All my folder names are correct but my actual .avi and .mkv files are a big mess and I would like to go in and clean up all my movie file names (1 file or CD1, CD2, along with subtitle files).  Not worried about tags, just want the file names to be clean.

Many man thanks in advance
Last edited by pilGrim on January 13th, 2009, 6:50 pm, edited 1 time in total.
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: Movie renaming based upon imdb

Post by switch »

0.5 can rename the files based on the folder name (which is based upon the nzb name), with full support for CD1/CD2 files, and renaming subs ect. You won't find any imdb fetching code in any official sabnzbd released for certain reasons.

The renaming is run before the script, so if you want imdb name checking you would have to either add it to sabnzbd code, or control the names of the nzb's that get added to sabnzbd.
jl0810
Newbie
Newbie
Posts: 18
Joined: December 27th, 2008, 8:01 am

Re: Movie renaming based upon imdb

Post by jl0810 »

is it possible to control the job name from the sabnzb api in 0.4.6?
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: Movie renaming based upon imdb

Post by switch »

Depends on how you are adding the file.

If you are adding by newzbin id, then no.
If you are adding by url, then no.
If you are uploading the nzb using mode=addfile then yes you can specify what the filename is.
jl0810
Newbie
Newbie
Posts: 18
Joined: December 27th, 2008, 8:01 am

Re: Movie renaming based upon imdb

Post by jl0810 »

thanks - yes, Im using addurl, so I guess no.  I probably can switch it around to filename with a little work
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: Movie renaming based upon imdb

Post by switch »

Be aware addfile does not expect a path, but the contents of the nzb in a certain way. See http://forums.sabnzbd.org/index.php?topic=998.0
Post Reply