0

Hope you can help with that... Kodi (former XBMC) needs to automatically identify the correct movie. The best way is to have a file called "movie.nfo" in the same folder as the video file(s). It simply contains the unique IMDB link to the movie. In most movie folders are already movie.nfo files with several information in xml format (sadly not successfully interpreted by KODI).

The information to extract from there is the unique movie ID. With this ID it is possible to generate a IMDB link and save it as movie.nfo (replace the old).

Example / How it should work:

  1. content of movie.nfo: " < id >tt0133093< / id >" (without spaces)
  2. get ID -> tt0133093
  3. generate link -> http://www.imdb.com/title/tt0133093/
  4. save the link in the new movie.nfo.

1. Snippet

REM Search DIR (current DIR/location)
set location=%cd%

REM For every DIR with a movie.nfo file look for the String "<id>"
FOR /F "delims=" "tokens=*" %%a in ('DIR %location% /AD /S /B') DO (IF EXIST "%%a\movie.nfo" (findstr "<id>" "%%a\movie.nfo")))



2. Snippet

REM This script snippet is from Aacini - https://stackoverflow.com/revisions/366c73ac-17b4-453e-b098-b78246c0184a/view-source - Thanks.
REM This script only works for one movie.nfo file, when executed in a folder with a movie.nfo file in it. 
REM The Goal is to make it work for ALL folders, containing a movie.nfo file (without a empty ID <- optional)
for /F "delims=" %%b in ('findstr "<id>" "movie.nfo"') do set "line=%%b"
rem Change left delimiter by {
set "line=%line:<id>={%"
rem Change right delimiter by }
set "line=%line:</id>=}%"
rem Get second token delimited by { and }
for /F "tokens=2 delims={}" %%b in ("%line%") do set string=%%b
echo http://imdb.com/title/%STRING% >> movie-2.nfo
member008
  • 11
  • 1
  • What is your actual question, and where are you currently having issues? – Warren Sergent Mar 19 '15 at 18:50
  • Hi Warren, I found a way to go through my filesystem (incl. subfolders) and check any folder if there is a movie.nfo in it. I also found a way to "extract" the IMDB ID out of ONLY ONE specific movie.nfo file and "build" a URL with it. What I would like to do is combining both ways. To scan through my whole filesystem and extract the IMDB ID & build a link (and save this link in the new movie.nfo, which replaces the old.) I don't know how to accomplish that (extracting the ID of all movie.nfo files not just one). The details (building link, saving, etc.) should be not a problem for me. Thanks. – member008 Mar 19 '15 at 20:38

0 Answers0