Can I modify how the Movie Database Scraper add on resolves movie names

  • I just started using LibreELEC and so far so great.

    I have a large collection of movies that I recorded from the TV. The movies are created with filenames that are not recognised by the Movie DB add-on.

    Filenames are always formatted like: "A - B - C" where A is a date, B is a TV channel and C is the movie name..

    Here are some examples:

    Filename: 20150813 2159 - NBC +1 - Prometheus.ts

    Movie Name: Prometheus

    Filename: 20150831 2159 - CBS+1 - The Bourne Identity.ts

    Movie Name: The Bourne Identity

    I understand that the best practice would be to rename all the files and even better to have each movie in its own folder with the name and year of the movie.

    However I would like to try can I add another regular expression to the tmdb.xml file so it will match movie names from the file names I have and still manage to download the metadata?

    I read this post about How to Write Media Scrapers and also from reading this Reddit Post I was thinking can I add a new regular expression in the tmdb.xml file something like this...

    Code
    <CreateSearchUrl dest="3">
    <RegExp input="$$7" output="&lt;url&gt;https://api.tmdb.org/3/search/movie?api_key=f090bb54758cabf231fb605d3e3e0468&amp;amp;query=\1@@@WCF_LITERAL_AMP@@@amp;year=$$4@@@WCF_LITERAL_AMP@@@amp;language=$INFO[language]&lt;/url&gt;" dest="3">
             <RegExp input="$$1" output="\1" dest="7">
                  <expression>(\d{8} \d{4} -.*?- ?(.*)\.ts$)</expression>
             </RegExp>
    </RegExp>
    <CreateSearchUrl>

    If this is possible then I'm also not sure which tmdb.xml file to edit. I searched and there are SIX:

    Code
    /storage/.kodi/addons/metadata.common.themoviedb.org/tmdb.xml
    /storage/.kodi/addons/metadata.themoviedb.org/tmdb.xml
    /storage/.kodi/addons/metadata.tvshows.themoviedb.org/tmdb.xml
    /usr/share/kodi/addons/metadata.common.themoviedb.org/tmdb.xml
    /usr/share/kodi/addons/metadata.themoviedb.org/tmdb.xml
    /usr/share/kodi/addons/metadata.tvshows.themoviedb.org/tmdb.xml

    I looked at them all, checking for differences between them and they are not all the same, some have slightly different content.

    After some more reading it looks like..

    ../http://metadata.common.themoviedb.org/tmdb.xml

    and

    ../http://metadata.themoviedb.org/tmdb.xml

    are a companion pair that work together and...

    ../http://metadata.tvshows.themoviedb.org/tmdb.xml

    surely isn't what I need since I am scrapping for movie metadata.

    The <CreateSearchUrl> tag is in...

    ../http://metadata.themoviedb.org/tmdb.xml

    So now my questions are:

    1. What is the difference between...

    /storage/.kodi/addons/http://metadata.themoviedb.org/tmdb.xml

    and

    /usr/share/kodi/addons/http://metadata.themoviedb.org/tmdb.xml

    2. Do I need to make changes to both files?

    3. Is there any special way to "re-install" the add-on after or will it just work when I make the changes to the xml file?

    Cheers,

    Flex

    Edited 3 times, last by flexmcmurphy: Posted it by accident when was not finished, (February 23, 2020 at 5:29 PM).

  • Wow - that is asking a lot - it might be possible but I doubt anyone on this forum has the skills to answer the question. You might be better off asking on the Kodi forums - but I reckon, you'll get the same answer - change your filenames.

    Someone might have a script that can change filenames to conform to Kodi standards but.....

    I had the same issue years ago - and yes I had to rename all of my files, but at least if was future proof.

  • Cheers Iridium,

    I'll try the Kodi forum then. Renaming everything I have now would be bad enough but it's having to keep doing that with new content going forward I'd prefer not to have to do... probably a lot of people give up maintaining a Kodi media collection for that reason... too much effort... easier to just use Netflix and Spotify :)

    Flex

  • For anyone reading this thread... I got a solution working that makes LibreELEC/Kodi recognise two file naming schemes.. the official Kodi compliant:

    Code
    moviename year.ext

    And another scheme that suits many movies I have in my collection that I recorded from TV such as:

    Code
    20150813 2159 - NBC +1 - Prometheus.ts

    The full thread is over on the Kodi forums.

    Cheers,

    Flex