AMC question regarding lang in movie.nfo file

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
bebop01
Posts: 8
Joined: 10 Nov 2014, 17:28

AMC question regarding lang in movie.nfo file

Post by bebop01 »

Hello Board & rednoah,

first of all, thanks a lot for the hard work with Filebot & AMC: it's working very well on my Synology DS213j.

I have a question: while it was working with previous Filebot versions (4.3 for sure; 4.4 I'm not sure), whereas I have the --lang fr option, the movie.nfo content remains in english (but the name of the directory & the file name are in french (as wanted))

Here is my Filebot command:

Code: Select all

filebot -script fn:amc --output "/volume1/data/Downloads/Output" --log-file amc.log --action move --conflict override -non-strict "/volume1/data/Downloads/Input" --lang fr --encoding UTF-8 --def music=n --def subtitles=fr,en --def artwork=y --def "movieFormat=/volume1/data/Downloads/Output/{n}/{n}" --def "seriesFormat=/volume1/data/Videos/Series/{n}/{'Season '+s.pad(2)}/{n} - {s00e00} - {t}" --def extras=n --def excludeList=amc.txt --log-file /volume1/data/Documents/.mgmt/logs/amc.log
Do you have any clue on how to fix this?

Regards
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC question regarding lang in movie.nfo file

Post by rednoah »

Yes, in the amc script the artwork/nfo code will ignore your language preference and always use English.

If you use the artwork.* scripts it will however respect your --lang preference.
:idea: Please read the FAQ and How to Request Help.
bebop01
Posts: 8
Joined: 10 Nov 2014, 17:28

Re: AMC question regarding lang in movie.nfo file

Post by bebop01 »

Hello rednoah,

thanks a lot for your quick answer: I will look for it in the documentation & post the result here.

Regards
bebop01
Posts: 8
Joined: 10 Nov 2014, 17:28

Re: AMC question regarding lang in movie.nfo file

Post by bebop01 »

Hello Board & rednoah,

thanks to your very good information, here is my filebot commands in order to have:
  • movies & tv shows renamming in french
  • nfo content & artwork in french downloading
  • missing tv shows subtitles downloading

Code: Select all

filebot -script fn:amc --output "/volume1/data/Downloads/Output" --log-file amc.log --action move --conflict override -non-strict "/volume1/data/Downloads/Input" --lang fr --encoding UTF-8 --def music=n --def subtitles=fr,en --def artwork=n --def "movieFormat=/volume1/data/Downloads/Output/{n}/{n}" --def "seriesFormat=/volume1/data/Videos/Séries/{n}/{'Season '+s.pad(2)}/{n} - {s00e00} - {t}" --def extras=n --def excludeList=amc.txt --log-file /volume1/data/Documents/.mgmt/logs/amc.log

filebot -script fn:artwork.tmdb --conflict override --lang fr -non-strict /volume1/data/Downloads/Output

filebot -script fn:artwork.tvdb --conflict override --lang fr -non-strict /volume1/data/Videos/Séries

filebot -get-missing-subtitles /volume1/data/Videos/Séries -r --lang fr --output srt --encoding utf8 -non-strict
Regards
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC question regarding lang in movie.nfo file

Post by rednoah »

You understand that the calls you added will repeatedly run through your entire collection each and every time. And artwork with --conflict override it's an especially bad idea. That will most likely get you banned if you call the script more than once a week. ;)

So make sure these scripts are only called on files that have not been previously processed.
:idea: Please read the FAQ and How to Request Help.
bebop01
Posts: 8
Joined: 10 Nov 2014, 17:28

Re: AMC question regarding lang in movie.nfo file

Post by bebop01 »

Hello rednoah,

thanks a lot for you feedback: in fact, I didn't understood this at all :oops:

After stopping my script in crontab, I have several comments:
  • for movies, since Output directory is a temporary one (not the entire movies directory), I think it's not an issue: in my entire movies directory, since I have kids & grown ups directories, I use this temporary Output directory: as a result I have to move movies after filbot processing. Nevertheless, I think I will change the option --conflict override. I also have the option --def artwork=n in order to avoid multiple artwork downloading
  • for tv shows, you're absolutly right, my filebot commands are scanning the whole tv shows directory: I have to review it! In the first place I made it like that in order to have nfo files in french
I'm going back to work on it, test & publish the final result

again, thanks a lot for the warning on --conflict override option & ban risk!

Regards
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC question regarding lang in movie.nfo file

Post by rednoah »

yeah, that should be fine then, you can always just run the command manually first, and then a second time, and then you'll immediately see if it's reprocessing stuff it already did. For subs you just have to take into account that sometimes there are no subtitles, so it'll always be missing, and it'll always be search for repeatedly.

With your temporary staging folder this shouldn't be an issue. You can also combine things with some nifty unix commands and only run on files that have been created recently. The suball subtitle script as some of that logic built in.
:idea: Please read the FAQ and How to Request Help.
bebop01
Posts: 8
Joined: 10 Nov 2014, 17:28

Re: AMC question regarding lang in movie.nfo file

Post by bebop01 »

Hello Board & rednoah,

thanks to rednoah's wise advise, here is my final filebot script in order to have:
  • Movies & TV shows renammed with french titles
    • movies are moved to a temporary folder; then, it allows me to move them in "kids" or "grown ups" folders in the media library)
    • TV shows are renamed & moved to the appropriate folder in the media library
  • french nfo content & artwork downloaded for movies
  • french nfo content & artwork downloaded for TV Shows
  • missing subtitles downloaded for TV shows
Here is my Filebot commands (played hourly with cron):

Code: Select all

# Movies & TV Shows renamming
filebot -script fn:amc --output "/volume1/data/Downloads/Output" --log-file amc.log --action move --conflict skip -non-strict "/volume1/data/Downloads/Input" --lang fr --encoding UTF-8 --def music=n --def subtitles=fr,en --def artwork=n --def "movieFormat=/volume1/data/Downloads/Output/{n} ({y})/{n} ({y})" --def "seriesFormat=/volume1/data/Videos/Séries/{n}/{'Season '+s.pad(2)}/{n} - {s00e00} - {t}" --def extras=n --def excludeList=amc.txt --log-file /volume1/data/Documents/.mgmt/logs/amc.log

# French nfo & artwork downloading for movies in temporary folder
filebot -script fn:artwork.tmdb --conflict skip --lang fr -non-strict /volume1/data/Downloads/Output

# French nfo & artwork downloading for TV shows in media library
filebot -script fn:artwork.tvdb --conflict skip --lang fr -non-strict /volume1/data/Videos/Séries

# TV Shows missing subtitles downloading
filebot -get-missing-subtitles /volume1/data/Videos/Séries -r --lang fr --output srt --encoding utf8 -non-strict
Since I have a Synology DS213j (Marvell Armada 370 processor: armv7l), there are no MediaInfo and 7-Zip native libraries: I'll try to compile it in order to have media information in the nfo files.

Regards
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC question regarding lang in movie.nfo file

Post by rednoah »

1.
When fetching subtitles, how do you avoid abuse?

Code: Select all

filebot -get-missing-subtitles -r ...
Since you call it on the root folder, it'll always check now subtitles, and if no subtitle will ever be available (possible for English, likely for French) it'll waste resources every single time. You need to find a way to avoid this. Wasting OpenSubtitles resources may get you banned.

2.
For ARMv7 the libmediainfo.so from here should work:
https://sourceforge.net/p/filebot/code/ ... ib/native/

The 7zip library is only confirmed to work on ARMv5 and is confirmed not to work on ARMv6/7.
:idea: Please read the FAQ and How to Request Help.
bebop01
Posts: 8
Joined: 10 Nov 2014, 17:28

Re: AMC question regarding lang in movie.nfo file

Post by bebop01 »

Hello rednoah,

thanks a lot for your answer (it means, I still have to work on it ;) ):
  1. You're completly right with "get-missing-subtitles" on the whole TV Shows part of the media library: As a result, in order to avoid abuse, I'm going to script it in shell in order to run "filebot -get-missing-subtitles" only on the ongoing TV Shows last season (I think I'll create a file in order to list these ongoing TV Shows).
  2. I'll have a look on libmediainfo.so. In order to have it working, I just have to copy it in filebot applicative folder? No Path variable modification?
  3. Regarding, 7zip library, I'll try to compile it: I'm just wondering, is it a mandatory dependency?
Regards
bebop01
Posts: 8
Joined: 10 Nov 2014, 17:28

Re: AMC question regarding lang in movie.nfo file

Post by bebop01 »

Hello rednoah,

regarding "get-missing-subtitles" optimization, I modified my script by creating a file Ongoing at the root of TV Shows folder in the media library. For example, here is the content of this file:

Code: Select all

Castle (2009)/Season 07
Scandal (2012)/Season 04
The Good Wife/Season 06
Here is the modified filebot script:

Code: Select all

# Movies & TV Shows renamming
filebot -script fn:amc --output "/volume1/data/Downloads/Output" --log-file amc.log --action move --conflict skip -non-strict "/volume1/data/Downloads/Input" --lang fr --encoding UTF-8 --def music=n --def subtitles=fr,en --def artwork=n --def "movieFormat=/volume1/data/Downloads/Output/{n} ({y})/{n} ({y})" --def "seriesFormat=/volume1/data/Videos/Séries/{n}/{'Season '+s.pad(2)}/{n} - {s00e00} - {t}" --def extras=n --def excludeList=amc.txt --log-file /volume1/data/Documents/.mgmt/logs/amc.log

# French nfo & artwork downloading for movies in temporary folder
filebot -script fn:artwork.tmdb --conflict skip --lang fr -non-strict /volume1/data/Downloads/Output

# French nfo & artwork downloading for TV shows in media library
filebot -script fn:artwork.tvdb --conflict skip --lang fr -non-strict /volume1/data/Videos/Séries

# TV Shows missing subtitles downloading
if [ -f /volume1/data/Videos/Séries/Ongoing ]
then
  while read LINE  
  do
    echo "Get missing subtitles for ${LINE}"
    filebot -get-missing-subtitles "/volume1/data/Videos/Séries/${LINE}" --lang fr --output srt --encoding utf8 -non-strict  
  done < /volume1/data/Videos/Séries/Ongoing
else
  filebot -get-missing-subtitles /volume1/data/Videos/Séries -r --lang fr --output srt --encoding utf8 -non-strict
fi
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC question regarding lang in movie.nfo file

Post by rednoah »

1.
The usage manual on the Synology package here in the forums should tell you how to "install" (i.e. make findable) the native libraries. Apart from certain features simply not working (e.g. no -extract without 7zip native code) all the native libs are completely optional.

2.
I recommend looking into the suball script. Might save you some work. It'll allow you to set a max-age for files for which it'll check for subtitles, e.g. only check for files that have been created/modified in the last 30 days.
:idea: Please read the FAQ and How to Request Help.
bebop01
Posts: 8
Joined: 10 Nov 2014, 17:28

Re: AMC question regarding lang in movie.nfo file

Post by bebop01 »

Hello rednoah,

thanks a lot for very good advice & sorry for having being too light in reading all the documentation: mediainfo & selective missing subtitles downloading (way better than my shell solution) are now working very well !

Here is the latest version of the shell script on my NAS:

Code: Select all

#!/bin/sh

export PATH="/bin:/usr/bin:/usr/syno/bin"
export LD_LIBRARY_PATH="/volume1/data/Documents/lib"
export DATE=`date +%Y%m%d`
export LOG_DIR="/volume1/data/Documents/logs"
export DWN_DIR="/volume1/data/Downloads"
export LIB_DIR="/volume1/data/Videos"

# Delete filebot logs older than 7 days
find ${LOG_DIR} -name *_filebot*\.log -mtime 7 -delete

# Movies & TV Shows renamming
echo "`date +%Y%m%d\ %H:%M` Step 1: Start of movies & TV Shows renaming" >> ${LOG_DIR}/${DATE}_filebot1_amc.log
filebot -script fn:amc --output "${DWN_DIR}/Output" --log-file amc.log --action move --conflict skip -non-strict "${DWN_DIR}/Input" --lang fr --encoding UTF-8 --def music=n --def subtitles=fr,en --def artwork=n --def "movieFormat=${DWN_DIR}/Output/{n} ({y})/{n} ({y})" --def "seriesFormat=${LIB_DIR}/Séries/{n}/{'Season '+s.pad(2)}/{n} - {s00e00} - {t}" --def extras=n --def excludeList=amc.txt >> ${LOG_DIR}/${DATE}_filebot1_amc.log

# French nfo & artwork downloading for movies in temporary folder
echo "`date +%Y%m%d\ %H:%M` Step 2: Start of movies nfo & artwork downloading" >> ${LOG_DIR}/${DATE}_filebot2_movies_nfo_artwork.log
filebot -script fn:artwork.tmdb --conflict skip --lang fr -non-strict ${DWN_DIR}/Output >> ${LOG_DIR}/${DATE}_filebot2_movies_nfo_artwork.log

# French nfo & artwork downloading for TV shows in media library
echo "`date +%Y%m%d\ %H:%M` Step 3: Start of TV Shows nfo & artwork downloading" >> ${LOG_DIR}/${DATE}_filebot3_tvshows_nfo_artwork.log
filebot -script fn:artwork.tvdb --conflict skip --lang fr -non-strict ${LIB_DIR}/Séries >> ${LOG_DIR}/${DATE}_filebot3_tvshows_nfo_artwork.log

# TV Shows missing subtitles downloading (aged more than 0.5 day & less than 45)
echo "`date +%Y%m%d\ %H:%M` Step 4: Start of TV Shows missing subtitles downloading" >> ${LOG_DIR}/${DATE}_filebot4_tvshows_missing_srt.log
filebot -script fn:suball ${LIB_DIR}/Séries --lang fr --output srt --encoding utf8 -non-strict --def minAgeDays=0.5 --def maxAgeDays=45 >> ${LOG_DIR}/${DATE}_filebot4_tvshows_missing_srt.log

exit 0
Post Reply