Posts: 2,339
Joined: Sep 2006
Reputation:
314
Hi Guys,
I have written a script that given a movies IMDB id, accesses TMDB api. Gets the TMDB id. Then gets the TMDB movie info. Then gets the youtube url. Then gets the token and full real url to the flv file that XBMC can then play.
Few questions. I want to modify Confluence so the Trailer button runs the script and sends it the current selected movies IMDB id.
Is there any skin setting to get movie IMDB info?
Any thoughts on how to get this info into my script would be great!
Posts: 2,339
Joined: Sep 2006
Reputation:
314
Few more features i will develop
1) the script will keep track via a db of IMDB id, youtube url, and FULL url (what xbmc needs to stream trailer)
2) when you select view trailer, it will see if the Full url is still valid, if not, it will get a new Full url via the youtube url.
If the imdb is not in the scripts DB, it will goto TMDB get the youtube url etc.
If TMDB does not have a youtuble url, it will search youtube for "videoname + trailer"
It will then display a list of trailers that the user can play and then select a good quality one. This then will be stored in the scripts DB.
ALSO, if TMDB will allow. It will then update the TMDB website with this youtube url
Posts: 2,339
Joined: Sep 2006
Reputation:
314
EG:
listitem.rating Shows the IMDB rating of the currently selected movie in a list or thumb control
but listitem.imdbid
Posts: 4,137
Joined: Jul 2009
Reputation:
48
amet
Retired Team-Kodi Member
Posts: 4,137
you can not get IMDB in the skin ATM, script can get it for the currently playing movie or query the db.
never tried getting the script to query the database though, sry
Posts: 2,339
Joined: Sep 2006
Reputation:
314
2010-02-03, 01:37
(This post was last modified: 2010-02-03, 01:40 by matthuisman.)
At present, doing it like this (UGLY)
filepath = xbmc.getInfoLabel('listitem.filenameandpath')
player = xbmc.Player()
player.play(filepath)
time.sleep(0.1)
info = player.getVideoInfoTag()
player.stop()
imdb = info.getIMDBNumber()
Would like to do like this:
imdb = xbmc.getInfoLabel('listitem.imdbid')
I have looked at xbmc db and all that would need to be done is copy the method in XBMC that gets the infolable for "listitem.year"
and rename it and change the XBMC DB column from "c07" to "c09"
It looks if all other columns (except id's etc) can be got from infolables EXCEPT IMDBID :-(
Posts: 2,710
Joined: Feb 2009
Reputation:
12
ppic
Skilled Python Coder
Posts: 2,710
why don't you take it directly in db ?
Posts: 2,339
Joined: Sep 2006
Reputation:
314
Well. To get from the DB, i would want the files "idFile" so I can be sure Im getting the correct movie. I don't want to query the xbmc db using its title or anything (multiple same titles etc may cause problems).
So, is there anyway to get the current listitems idFile?
So, i can "RunScript" on the trailer button using this idfile as a parameter to my python script then query the DB for the imdb number.
Posts: 2,710
Joined: Feb 2009
Reputation:
12
ppic
Skilled Python Coder
Posts: 2,710
with the path, you'll have the correct movie !
Posts: 2,339
Joined: Sep 2006
Reputation:
314
Haha yup!!
Thanks mate! :d