[WS] imdb

Mp3tag v2.45 mandatory

How do I install the script? / Wie installiere ich das Script?

imdb
Tag movies or tv shows with mp4 container.
Scripts:
imdb#Search Movies imdb#Search TV Episodes imdb#URL imdb id
Imported Tags:
  • Standard: Artist, Album, Title, Year, Comment, Composer, Cover
  • Custom: Releasedate, Airdate, Cast, Language, Rating, IMDB Id, Country
  • iTunes supported: Releasetime, ITUNESMEDIATYPE, Subtitle, ITUNESPODCASTDESC, TVEpisode, TVSeason, TVShow
## Scroll down for updates ##

Good news

Perhaps in the future will be possible to get info for all formats and save them in separate xml files? Excellent.

In case anyone is interested, the following (when added to end of the Movie script) should get you the MPAA Certification (which will show up in iTunes).

Please note that because (as far as I can tell) the scripting language does not support writing the pipe ("|") symbol (can't even be escaped to get it in), you have to run an action after the fact to replace the "@" symbol with an "|" for iTunEXTC.

# Cert
findline "USA:" 1 1
unspace
if "USA:"
    movechar 4
     outputto "iTunEXTC"
    
    replace "|" ""
    replace " " ""
        replace "USA:G" "mpaa@G@100@"
        replace "USA:PG-13" "mpaa@PG-13@300@"
        replace "USA:PG" "mpaa@PG@200@"
        replace "USA:R" "mpaa@R@400@"
        replace "USA:NC-17" "mpaa@NC-17@500@"
        replace "USA:Unrated" "mpaa@Unrated@???@"
        replace "USA:Approved" "mpaa@PG-13@300@"
        replace "USA:Passed" "mpaa@PG-13@300@"
        replace "USA:NotRated" "mpaa@Not Rated@000@"
        replace "USA:TV-MA" "us-tv@TV-MA@600@"
        replace "" "mpaa@Not Rated@000@"
        sayuntil "</a>"
else
    outputto "iTunEXTC"
        say "mpaa@Not Rated@000@"
        findline "<html>" -1
endif

Also, I think iTunes may have some problems with the fact that MP3Tag writes the iTunEXTC tag in all upper case... So I have created (as part of the "@" to "|" Action) a rule that properly re-writes the tag:

Replace with regular Expression
_FIELDNAME
ITUNEXTC
iTunEXTC

I have attached an updated IMDB web source script for IMDB, which meets my needs for "all the metadata that I can get"... :slight_smile:

In addition, I have attached 3 Actions which should be run on the file(s) in question, AFTER the web script has been run to complete the "work".

Download the web script
Place the script in: %appdata%\mp3tag\data\sources

  • Download the 3 action files "Finish Setting Video Tags.mta" and "Fix Tag Case (iTunEXTC, etc).mta" and "Find bad plist.mta"

  • Copy the files to directory:
    %appdata%\Mp3tag\data\actions

I recommend running the actions in this order (so place them in the actions dialog of MP3Tag in this order):

  1. Find Bad Plist (in case the script screwed up, and the plist is broken)
  2. Finish Setting Video Tags (copies information to other relevant tags
  3. Fix Tag Case (so for example, ITUNEXTC becomes iTunEXTC)

The web script as it stands pull and populates/stores the following data in your mp4 file:

  • Artists ("/" delimited)

  • Genre (the first non-"Drama". If only "Drama" exists, use it)

  • Composer (i.e. writters, "/" delimited)

  • IMDB ID

  • IMDB Rating

  • Director ("/" delimited)

  • Producer ("/" delimited)

  • ReleaseDate

  • MPAA Rating and REASON (stored in iTunEXTC. Reason is not used anywhere yet AFAIK).

    • If rating is "USA:NC-17", then the itunes "Advisory" tag is also set.
  • Description

  • Tagline

  • IMDB Keywords

  • iTunMOVI (which Apple TV etc uses), containing:

  • Studio
  • Screenwriters
  • Directors
  • Producers
  • Cast

Given a couple of limitations/bugs in mp3tag, you have then then create and run the following action on the file AFTER running the web script:

  • Right click on the file you just ran the script on, and select: "Convert" and then "Actions"

  • Make sure only "Finish Setting Video Tags" and "Fix Tag Case (iTunEXTC, etc)" and "Find bad plist" have their checkboxes "checked", and are in the order that I originally mentioned at the top of this post.

  • Click "Ok"

Hope this helps people.

<<EDIT: "Country" was a little finiky, so I removed it... Makes the script more stable overall...>>

imdb_web_source_and_actions.zip (3.84 KB)

I have updated the script to correct an issue with updated IMDB format (for example, previously you could type in the ttXXXXXX number from IMDB into the search box, but the IMDB changes broke that... This has been corrected.

Also, I have added an action which you may or may not want to use... This action ("Set iTunesHD") sets the iTunes HD flag, if the file size is greater than 1400 MB. That's the only check, as that's all the MP3Tag provides... So yes, even a non-HD video could be tagged as HD. Use if you are fine with that, ignore that action if you don't like it...

[EDIT: Note that you need version 2.46c or newer for this version (unless you don't use the HD action]

imdb_web_source_and_actions.zip (4.13 KB)

Updated to work with the field name changes introduced in version 2.46d of MP3Tag.
Will not work with versions earlier than 2.46d

imdb_web_source_and_actions_2.46d.zip (4.11 KB)

A small update, and note:

  1. You might notice that the script sometimes gives errors when you search IMDB by name, and if the name is a direct hit. In this case, I recommend that you simply enter the IMDB ID in the search box (easiest way to find the IMDB ID is to "ttXXXXXX" part of the IMDB URL of the video.
  2. I have modified the actions so that the ALBUMARTIST is now the first artist listed in IMDB. Previously, the same value as the ARTIST tag was used (full list).
  3. I have included an extra Web Source which uses the Apple Web Services to retrieve the CATALOGID tag. This is a bit "janky" at the moment, so use your judment to ensure it is the correct one. To help in ensuring the number is the correct one, the name of the video from the source is also returned.

imdb_web_source_and_actions_2.48.zip (4.77 KB)

Quick update.
Exactly the same as the previous item, just fixed the Apple Web Script to make it not "janky"...

imdb_web_source_and_actions_2.48.zip.zip (5 KB)

Updated for version 2.48e.
Please note that for some of the tags to work "properly" (e.g. Rate, Keyword), version 2.48e or higher of mp3tag must be used.

Additions / Changes:

  1. Using the new "_video_width" property to set iTunesHD flag if the width is greater or equal to 1280. Previously (without this attribute being present), the file size was used to set the flag (as a guess, which could easily be incorrect).
  2. The new "Rate" tag is set based on the IMDB Rating. This value is out of "100" so if the imdb rating is "8.2/10" the value will be "82"
  3. The new "Kewords" tag is set to the keywords found in IMDB

[Edit] As an FYI, as mentioned in previous threads, I find that using the IMDB ID as the search criteria is the most fail proof means of using the script. [/edit]

imdb_web_source_and_actions_2.48e.zip (5.07 KB)

A small update...

Addition:

  1. The SUBTITLE tag will now be populated, and also contains the same description as that which is in PODCASTDESC.

imdb_web_source_and_actions_2.48e_20120106.zip (5.3 KB)

A few changes - Note that version 2.50 is required to run the script:

  • Use the new $verticalbar() function in the Web Source (for iTunEXTC tag)
  • As part of the Actions, if the "iTunMovi" atom has value '7:720p' within it (the default value set in the Web Source), the Action will update to 720p or 480p based on video width
  • As part of the Actions, if the "iTunMovi" atom has the 'high-definition' key within it (the default value set to 'true' in the Web Source), the Action will update to true/false based on video width
  • Take into account, and set the new 1080i/p value of hdvd (which is 2).

PS. If you've tagged old videos using previous version, simply running the Actions on the files again will update the relevant tags.

imdb_web_source_and_actions_2.50_20120424.zip (5.56 KB)

Thanks for this script, maybe I can test them out on some of my mistagged for trakt TV shows on my XBMC TV-Show playlist.... :slight_smile:

Update to IMDB scraper due to IMDB page re-designs.

imdb_web_source_and_actions_2.50_20121211.zip (5.56 KB)

Edrikk,
This is a very nice script, thanks for your work keeping it well maintained. Your work has inspired me to build my own revision based heavily on your design.

I have included my script in this post so that you may take from it any features you like.

I added a new column in the search results window that displays the type of result. (Movie, TV Show, Game etc.)

I've also added several tags as well as image scraping/tagging to this script.

Thanks again for all your work on this script, I hope you find my additions as useful as I've found your script. :slight_smile:

CyberDemon

IMDB__iTunes_mp4__mp3tag_Web_Source_Script.zip (3.56 KB)

This is a great script and does exactly what I want it to, however it seems The Actors (cast) and Director fields doesn't apply to the mp4 file when I run the script.

Any suggestions would be helpful. Here is what I am using from CyberDemon, Edrikk and Dano's scr. Do I need to adjust the code?

	### Directors ###
		findline "<html" -1
		findline "<h5>Director" 1 1
		unspace
		if "<h5>Director"
			#Save Directors
			outputto "Director"
			joinuntil ""
		sayregexp "(?<=;\">)[^<]+(?=<)" ", "
		
		# Append Directors to iTunMOVI
		outputto "iTunMOVI"
		say "<key>directors</key><array><dict><key>name</key><string>" 
		joinuntil "</div>"
		sayoutput "Director"
		say "</string></dict></array>"
		saynewline
	endif

### Actors ###
	findline "<html" -1
	findline "<h3>Cast</h3>" 1 1
	if "<hr/>"
		#Save Actors
		outputto "Artist"
		sayregexp "(?<=(/|;)\">)[\s\S]{1,50}(?=</a></td><td\sclass=\"ddd\">)" ", " "</table>"
		
		# Append Directors to iTunMOVI
		outputto "iTunMOVI"
		say "<key>cast</key><array><dict><key>name</key><string>"
		sayoutput "Artist"
		say "</string></dict></array>"
		saynewline
	endif
	
### Close iTunMOVI XML ###
	outputto "iTunMOVI"
	say "</dict>"
	saynewline
	say "</plist>"
	saynewline</div>

Hi there
Hoping that someone can help with this enquiry
I have used the scripts successfully in the current version of MP3tag however I am trying to work out how to extend the number of characters in the Plot/Description field.

######### Plot
findline "<html" -1
findline "

Plot:" 1 1
unspace
if "
Plot:"
outputto "podcastdesc"
moveline 2
sayuntil "<a"
else
findline "<html" -1
endif

When I use this scripts it cuts off the end of the description (from Steel Magnolias movie):
"Revolving around Truvy's Beauty Parlor in a small parish in modern-day Louisiana, STEEL MAGNOLIAS is..."

How can I fix this?
Any help would be greatly appreciated.
Thanks

If you look at the source code of the page then you find that the plot description does not exist in more detail on that page but links to a separate page... so unless you find a way to open that separate page, you are stuck with the short description.