Hi Guys,
If you are like me, you are particular about what information is stored in your movie.nfo
While JAV Movie Scraper is AWESOME, it generates too much info for my liking and also doesn't allow us to customize what data we want in certain fields.
I have been using a script (windows batch file) to remedy this for quite some time now. It manipulates the generated movie.nfo to move stuff around and remove unwanted stuff.
Hopefully these things will be implemented in JAV Movie Scraper so i can stop using this extra tool.
I am gonna post this script with an explanation of what it does so you can customize it to your liking. Those of you desperately wanting the option to have the ID ONLY used as the title, this will do it for you.
Command-Line Tools Needed For This Script
You need to download and extract these 2 command-line utilities to make this work. Extract them to a folder that is in your PATH environment variable.
The Actual Script
Code:
@Echo off
REM **********************************************
REM Fix JAV .nfo v1.3 - (c) Pr.Sinister
REM
REM Reformat JAV NFO to suit my needs
REM **********************************************
setlocal ENABLEDELAYEDEXPANSION
for /R %1 %%l in (movie.nfo) do (
cd %%~dpl
xml -q ed -L -d movie/set movie.nfo
xml -q ed -L -d movie/trailer movie.nfo
xml -q ed -L -d movie/thumb movie.nfo
xml -q ed -L -d movie/fanart movie.nfo
xml -q ed -L -d movie/runtime movie.nfo
xml -q ed -L -d movie/votes movie.nfo
xml -q ed -L -d movie/rating movie.nfo
xml -q ed -L -d movie/sorttitle movie.nfo
xml -q ed -L -d movie/mpaa movie.nfo
xml -q ed -L -d movie/top250 movie.nfo
xml -q ed -L -d movie/originaltitle movie.nfo
for /F "tokens=*" %%a in ('xidel -q movie.nfo --extract //title') do set title=%%a
for /F "tokens=*" %%a in ('xidel -q movie.nfo --extract //id') do set id=%%a
for /F "tokens=*" %%a in ('xidel -q movie.nfo --extract //plot') do set plot=%%a
echo Fixing !id!...
xml -q ed -L -u movie/title -v "!id!" movie.nfo
xml -q ed -L -u movie/outline -v "!plot!" movie.nfo
xml -q ed -L -i movie/year -t elem -n originaltitle -v "!title!" movie.nfo
xml -q ed -L -i movie/studio -t elem -n tag -v "JAV" movie.nfo
)
cd ..
Echo Done.
Usage
Save the script to a batch file (eg. fixjavnfo.bat or fixjavnfo.cmd) in a folder that is also in your path
The first commands where you see
xml -q ed -L -d will delete that specified element. So anything in that element is also deleted. This means the current script deletes the following elements:
- <set> (Too Inconsistent)
- <trailer> (I save the trailer to a local file)
- <thumb> (Conflicts with the images saved locally)
- <fanart> (I'm sorry but the DVD jacket is not fanart)
- <runtime> (Kodi gets the runtime from the file itself)
- <votes> (I don't care what others think)
- <rating> (Same as above)
- <sorttile> (I sort on the ID which i will set as the title)
- <mpaa> (MPAA doesn't rate JAV titles)
- <top250> (IMDB Top 250? Really? lol)
- <originaltitle> (I don't read Japanese so it's useless for me)
The next 3 commands simply extract the
Title, the
ID and the
Plot
The last commands do the following:
- Copy the <id> to the <title> element
- Copy the <plot> to the <outline>
- Copy the old <title> to the <originaltitle>
- Add a JAV tag (I like to differentiate between XXX and JAV)
Simple stuff no? So anything you do not want to remove from your movie.nfo, just REM the like or delete it. Anything else you want to do should be pretty easy to figure out but if you can't just post here and i will gladly help.
Hope this is useful for someone...If it is, just say thanks!
