希望您能对此有所帮助... Kodi(前 XBMC)需要自动识别正确的电影。最好的方法是在与视频文件相同的文件夹中放置一个名为“movie.nfo”的文件。它仅包含电影的唯一 IMDB 链接。在大多数电影文件夹中,movie.nfo 文件已经包含一些 xml 格式的信息(遗憾的是,KODI 没有成功解释)。
从中提取的信息是唯一的电影 ID。使用此 ID,可以生成 IMDB 链接并将其保存为 movie.nfo(替换旧的)。
示例/它应该如何工作:
- movie.nfo 的内容:“<id>tt0133093</id>”(不带空格)
- 获取 ID -> tt0133093
- 生成链接-> http://www.imdb.com/title/tt0133093/
- 将链接保存在新的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