BinaryWorks.it Official Forum
BinaryWorks.it Official Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 eXtreme Movie Manager 8, 9, 10 Forum
 Scripts
 Brand new script for TMDb API3
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3 Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

rocman
Junior Member

Australia
117 Posts

Posted - 27 Jan 2013 :  20:38:24  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello there...

I wrote a new script for the API3 of themoviedb.org.

The script supports the following features:
Languages (more are possible if needed):
- English
- German
- Italian
- French

Movie Search:
All movie titles in the search list are english! Nevertheless your import will be localized in your choosen language! If you want localized movie titles in the search list you have to edit the script (change language=en to language=de or language=it or language=fr in #WEBQUERY# string)! Maybe Alessio or I can upload localized script versions, but this would result in a total of 8 new scripts (4 for movie imports, 4 for actor imports). I didn't find a way to use other variables in the #WEBQUERY# string than #MOVIE#!
The script checks if there is a translated version of your searched movie on TMDb. If so it shows this in your search results or the script falls back to english import. In front of each search result you see what language will be imported. Furthermore you can see the movie release year.

Movie data:
- MovieID
- Movie title
- Original movie title
- Director/s
- Actors (name, character in movie)
- Actors extended data (picture [scaled or full size], birthday, deathday, biography, birthplace [town and country], filmography, webid)
- Genre/s (seperately in XMM8)
- TMDb rating
- Plot
- Tagline
- Runtime
- Production countries
- Movie release year
- Poster/s (scaled or full size)
- Backdrop/s / Fanart (full size only)
- Producer/s
- Writer/s
- Photographer/s
- Composer/s
- Production studio/s
- MPAA (localized, with US fallback)
- Official website
- Budget -> in Custom 1 or Budget in XMM8
- Revenue -> in Custom 2 or Revenue in XMM8
- Release Date -> in Custom 3
- IMDB-Link -> in Custom 8 or IMDB Link in XMM8

Options:
- Language (EN, DE, IT, FR)
- Poster (none, only first one, all)
- Postersize (scaled to width 500, full size)
- Backdrop (none, only first one, all)
- Detailed actors information (no, yes)
- Overwrite existing detailed actors information (no, yes) -> speed up import if actor already exists in database
- Actors picture (no, yes)
- Actors picture size (scaled to width 185, full size)

An actor only import script is available, too!

You can download the scripts here:
https://docs.google.com/folder/d/0Bx5mVBWjZDagNHdHRUJXVGxFelE/edit
Click on script, then choose File -> Download!

I also mailed them to Alessio for uploading to server.

If you find any bugs, you can write it down here. I will have a look after it...

Edited by - rocman on 27 Jan 2013 20:40:01

deafvader
New Member

United Kingdom
76 Posts

Posted - 30 Jan 2013 :  18:28:37  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
When i change the default settings of the script it doesn't seem to work for me anymore.

I think a user config file is not being made when changes are done.

Edited by - deafvader on 30 Jan 2013 18:33:10
Go to Top of Page

rocman
Junior Member

Australia
117 Posts

Posted - 31 Jan 2013 :  08:07:36  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
What option you are changing and what does not work then? I will have a look after it...
Or do you mean that your settings are not saved? Check if the <scriptname>.txt file is not read only.
Go to Top of Page

deafvader
New Member

United Kingdom
76 Posts

Posted - 01 Feb 2013 :  04:44:10  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The options i changed are all fanart, overwrite actor's. Search doesn't find any film. If i reset them back search works
again. Read only is not ticked.

I'm currently booted into Win7, so it could be a permissions thing. I'll see what it happens when i go back to XP.
Go to Top of Page

rocman
Junior Member

Australia
117 Posts

Posted - 01 Feb 2013 :  18:29:05  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ah... yes, you're right.
I found the error - there's a wrong jump point in the script, if you change a specific option.
I will upload the new version, asap.

--- EDIT ---
OK, update is online. Your search should work now with your settings.

Edited by - rocman on 01 Feb 2013 20:13:10
Go to Top of Page

rocman
Junior Member

Australia
117 Posts

Posted - 04 Feb 2013 :  21:06:16  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Version v1.5.1 of "THEMOVIEDB.ORG(API3)" and v1.2.1 of "THEMOVIEDB.ORG[Actors](API3)" is now online for both XMM7 and XMM8 (refer to the link in the first posting)!

Fixes:
- movies without actor information (no actors) are now importing properly
- actor biography with special characters is now fully imported
- added some special character substitutions
- some other optimizations which i don't remember :P
Go to Top of Page

RedAlan
Starting Member

7 Posts

Posted - 08 Feb 2013 :  15:03:13  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi rocman,

When i use your script (i've changed language=en to language=fr on the webquery and webqueryid), i have this engine error :
5-Le serveur distant a retourné une erreur : (406) Non acceptable....http://api.themoviedb.org/3/search/movie?api_key=72cae7941bfe23850229828662c9e4b8&query=1001 Pattes&language=fr&include_adult=false

Have you an idea on this error ?
Go to Top of Page

rocman
Junior Member

Australia
117 Posts

Posted - 08 Feb 2013 :  18:14:30  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sounds that you are using the XMM7 version of the script with XMM8.
Try to download the "THEMOVIEDB.ORG(API3)_for_Rel_8.txt" script or add the following line to the script:
#USEOLDENGINE#=TRUE

(for example below the line with #SCRIPTGENERATION#)

Edited by - rocman on 08 Feb 2013 18:15:01
Go to Top of Page

RedAlan
Starting Member

7 Posts

Posted - 08 Feb 2013 :  23:06:02  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Marvelous, it work fine.
Thanks a lot !

I've just found a little bug : the url stored regarding the film card is not good, for example :

http://www.themoviedb.org/movie/9444?api_key=72cae7941bfe23850229828662c9e4b8&language=FR&append_to_response=casts,releases

in place of :

http://www.themoviedb.org/movie/9444


Edited by - RedAlan on 08 Feb 2013 23:36:01
Go to Top of Page

smuche55
Starting Member

France
10 Posts

Posted - 15 Feb 2013 :  23:51:19  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi !

I do this to put "collection name" in "custom4" :
#CUSTOM4#
#STARTREADWEB#
#FINDLINE#="belongs_to_collection":{"id"#10# #ONERROR#=*OK*
#IF# #10#==#00#
#WRITEWARNING#= attention pb de site
#GOTO#=NOCOLLECTION
#ENDIF#
#FIND#="belongs_to_collection"#11# #ONERROR#=*OK*
#FIND#="name"#11# #ONERROR#=*OK*
#FIND#=,#12# #ONERROR#=*OK*
#COMPUTEVAR#=#11#+7
#COMPUTEVAR#=#12#-1
#TAKEWORD#=#13#,#11#,#12#
#TAKECUSTOM4#=#13#
:NOCOLLECTION
#ENDCUSTOM4#

But i perfer to have the name of collection in english (not in french)
How can i do this ?
i test with open/loadwebslot and opennewweb, i think i dont use the good term.

Sorry for my poor english :'(
Go to Top of Page

rocman
Junior Member

Australia
117 Posts

Posted - 16 Feb 2013 :  11:09:15  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I assume that you changed your script language to "fr".
In this case you have to open a new website to get the english collection name.
Try this:
Exchange #STARTREADWEB# with the following code:
#STRING#=#07#=http://api.themoviedb.org/3/movie/#70#?api_key=#79#&language=en
#OPENNEWWEB#=#07#

Then add #RESTOREWEB# after your :NOCOLLECTION
Go to Top of Page

smuche55
Starting Member

France
10 Posts

Posted - 16 Feb 2013 :  14:35:32  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It doesn't work and return nothing
In magic script editor, the script always go this way :
#IF# #10#==#00#
#WRITEWARNING#= attention pb de site
#GOTO#=NOCOLLECTION

never find "belong_..."

Sorry for my poor english :'(
Go to Top of Page

rocman
Junior Member

Australia
117 Posts

Posted - 16 Feb 2013 :  15:14:47  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ah... I see... there is a difference with #OPENNEWWEB# / #FINDLINE# and if there is only one websiteline returned...
This should work for you:
#CUSTOM4#
	#STRING#=#07#=http://api.themoviedb.org/3/movie/#70#?api_key=#79#&language=en
	#OPENNEWWEB#=#07#
	#STARTREADWEB#
	#FIND#="belongs_to_collection":{"id"#11# #ONERROR#=*OK*
	#IF# #11#==#00#
		#WRITEWARNING#= attention pb de site
	#GOTO#=NOCOLLECTION
	#ENDIF#
	#FIND#="name"#11# #ONERROR#=*OK*
	#FIND#=,#12# #ONERROR#=*OK*
	#COMPUTEVAR#=#11#+7
	#COMPUTEVAR#=#12#-1
	#TAKEWORD#=#13#,#11#,#12#
	#TAKECUSTOM4#=#13#
	:NOCOLLECTION
	#RESTOREMAIN#
#ENDCUSTOM4#
Go to Top of Page

smuche55
Starting Member

France
10 Posts

Posted - 16 Feb 2013 :  16:02:00  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank

it work well.

Sorry for my poor english :'(
Go to Top of Page

g40
Starting Member

Italy
3 Posts

Posted - 18 Feb 2013 :  17:11:51  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi rocman, thank you for your script, it's great! I'm using it with italian language, I choose number 3 in option and change language=en with language=it in editor. Script work well but sometimes it import english version of movies, I have search these movies on tmdb website and there are an italian version with italian title. so sometimes something goes wrong choosing languages..I have also try to deselect "take direct link if only one is found" in xmm option, so when I have to choose film in direct link script engine I read: [IT] with english film title. can you help me? thank you

Edited by - g40 on 18 Feb 2013 17:15:19
Go to Top of Page

rocman
Junior Member

Australia
117 Posts

Posted - 19 Feb 2013 :  17:40:35  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Do you have one or two movie examples? Then its easier for me to have a look after it.
Go to Top of Page

g40
Starting Member

Italy
3 Posts

Posted - 19 Feb 2013 :  18:17:20  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thank you for your answer, italian and english title are:
Il signore degli anelli: le due torri -> The Lord of the Rings: The Two Towers
le crociate -> Kingdom of Heaven

also plot doesn't appear...
Go to Top of Page

smuche55
Starting Member

France
10 Posts

Posted - 19 Feb 2013 :  19:35:09  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
the script have the same problem then Imdb's script.

symbol with a " ^ " on the top are wrong " â ê î ô û Â"
the script doing a thing like that "i'" with "'" on the top the "i"

Sorry for my poor english :'(
Go to Top of Page

rocman
Junior Member

Australia
117 Posts

Posted - 19 Feb 2013 :  21:49:14  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
@g40:
There is a bug or maybe a "feature" in TMDb API that caches your queries somehow. In short this means you search the movie with language=it (which is correct) and then you use the movie link with language=IT (uppercase, which is not a correct country value for the API). Thats why you get empty plots and no title translations.

I fixed the script. Internally it should now use only lowercase county codes and it should work now.
Don't forget to change the #WEBQUERY# for your needs again (language=it).

You can download the fixed script from my first posting or wait until Alessio has uploaded it to the server.

@smuche55:
Can you give me some movie examples? Its easier for me to look after the wrong chars because I don't speak french (I'm limited to "je ne sais pas" or "je ne comprend pas" ).
Go to Top of Page

rocman
Junior Member

Australia
117 Posts

Posted - 19 Feb 2013 :  22:00:36  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
v1.8.1 of "THEMOVIEDB.ORG(API3)_for_Rel_8"
v1.2.3 of "THEMOVIEDB.ORG[Actors](API3)_for_Rel_8"
is now online for XMM8 and

v1.5.3 of "THEMOVIEDB.ORG(API3)"
v1.2.3 of "THEMOVIEDB.ORG[Actors](API3)"
is now online for XMM7

Refer to the link in the first posting!

Fixes:
- added import of up to 3 trailers (XMM8 script only)
- added import of keywords (XMM8 script only)
- added import of Web-IDs for all crew members (XMM8 script only), ATTENTION: these are different from IMDB Web-IDs!
- added import of collections to CUSTOM4 = means "Matrix" belongs to "Matrix Collection" (XMM8 script only) -> thanks to smuche55 for the idea
- workaround for cached api queries for better translation results (country code has to be lowercase)
Go to Top of Page

g40
Starting Member

Italy
3 Posts

Posted - 20 Feb 2013 :  09:54:21  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you rocman, now it's perfect!
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic   Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
BinaryWorks.it Official Forum © Binaryworks.it Go To Top Of Page
Generated in 2.99 sec. Powered By: Snitz Forums 2000 Version 3.4.07