Youtube Trailer Via TMDB Python Script
#1
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!
Reply
#2
stanley87 Wrote: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!

you can get IMDB id in Python script

http://ankara.baskent.edu.tr/~obaskin/xb.../xbmc.html Look for getIMDBNumber(...)

Amet
Reply
#3
Amet Wrote:you can get IMDB id in Python script

http://ankara.baskent.edu.tr/~obaskin/xb.../xbmc.html Look for getIMDBNumber(...)

Amet


Can you get it from the skins control list?
I want the script to be run from the video library.

Eg: In options, the Trailer button is remapped to "executescript['trailer.py imdbid=skin.getselectedvideo[imdbid]"
ETC
Reply
#4
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
Reply
#5
EG:
listitem.rating Shows the IMDB rating of the currently selected movie in a list or thumb control
but listitem.imdbid
Reply
#6
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
Reply
#7
Amet Wrote: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


Yeh, might have to query DB. As, you don't want to play a trailer when the movie is playing Big Grin.

hmm, looking into query DB, there is no listitem that returns any ID of the file Sad
So, it would make queering the XBMC DB difficult :-(

HOPE SOMEONE CAN HELP!!
Sure adding a new listitem.imdbid would not be to hard + skinners then could show the IMDB in there skin if need be
Reply
#8
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 :-(
Reply
#9
why don't you take it directly in db ?
Reply
#10
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.
Reply
#11
with the path, you'll have the correct movie !
Reply
#12
seems you got it !
Big Grin
Reply
#13
Haha yup!!

Thanks mate! :d
Reply

Logout Mark Read Team Forum Stats Members Help
Youtube Trailer Via TMDB Python Script0