Extract list of movies from the XBMC Library
#1
I'm working on a trailer downloading program. Does XBMC keep a list of all the movies in the users library, or would I need to get each movie name myself? Also, does XBMC support any particular naming conventions for trailers? Ie. append -trailer to the filename or update the .nfo? Thanks!
Reply
#2
You can easily retrieve all movies through the JSON-RPC API.
Reply
#3
If you're working on a program the best way is a sql query on the database (mysql database if it is shared in the network and sqlite if it is local).
The trailers are string links to the trailer in a column in the database (movieview.c19 http://wiki.xbmc.org/index.php?title=XBM...eo_Library).
I'm pretty sure that xbmc doesn't edit the nfos. If you have an nfo file xbmc scrape the data from the nfo and put it in the library and after that only uses the library without look at the nfo again.
Reply
#4
(2014-02-09, 21:21)phate89 Wrote: If you're working on a program the best way is a sql query on the database (mysql database if it is shared in the network and sqlite if it is local).
The trailers are string links to the trailer in a column in the database (movieview.c19 http://wiki.xbmc.org/index.php?title=XBM...eo_Library).
I'm pretty sure that xbmc doesn't edit the nfos. If you have an nfo file xbmc scrape the data from the nfo and put it in the library and after that only uses the library without look at the nfo again.

That is a very complicated approach. You'll need to support MySQL and SQLite, NFO reading and what not.
Just use XBMC's JSON-RPC API with VideoLibrary.GetMovies and you will get a list of all movies with their name and you can even get the "trailer" property to see what items already have a trailer. Then you can do the trailer downloading and use VideoLibrary.SetMovieDetails to set the path of the downloaded trailer for every movie so it is also available in XBMC.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#5
(2014-02-09, 21:50)Montellese Wrote:
(2014-02-09, 21:21)phate89 Wrote: If you're working on a program the best way is a sql query on the database (mysql database if it is shared in the network and sqlite if it is local).
The trailers are string links to the trailer in a column in the database (movieview.c19 http://wiki.xbmc.org/index.php?title=XBM...eo_Library).
I'm pretty sure that xbmc doesn't edit the nfos. If you have an nfo file xbmc scrape the data from the nfo and put it in the library and after that only uses the library without look at the nfo again.

That is a very complicated approach. You'll need to support MySQL and SQLite, NFO reading and what not.
Just use XBMC's JSON-RPC API with VideoLibrary.GetMovies and you will get a list of all movies with their name and you can even get the "trailer" property to see what items already have a trailer. Then you can do the trailer downloading and use VideoLibrary.SetMovieDetails to set the path of the downloaded trailer for every movie so it is also available in XBMC.
Your approach is easier (if you know sql and web request/responses the same way) and more reliable but it needs xbmc fully running and with external control enabled right?
Reply
#6
The JSON-RPC API sounds like what I'm after. A the moment I am getting a list of files in the movie dir and building an url from the filenames, which is working pretty well. However to be able to make a call to the API and see whether or not the trailer exists would super handy! Now, I've got to figure out how JSON works. Thanks for pointing me in the right direction. Trailer scraping is something I feel is sorely missing from XBMC!

Edit : This is a stupid question, but does XBMC need to be running to access the JSON-RPC API?
Reply
#7
Yes XBMC needs to be running. IIRC the TheMovieDB scraper supports trailer scraping. At least in its settings you can choose whether to download trailers and what quality you would like to get.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#8
I've never been able to get TMDB to download trailers! While youtube does work, every now and then I run into a trailer that buffers for ages. For the time being I will just grab the filenames myself and rename them to 'movie/trailer/movie-trailer.mov'
Eventually I'd like to turn this into an XBMC addon but that is more than likely a few weeks if not months away. I'd like to get the whole lot working as a script first, and then convert it to an addon. I'm pretty new to python, so might as well take the long route!
Thanks for your help Montellese!
Reply

Logout Mark Read Team Forum Stats Members Help
Extract list of movies from the XBMC Library0