Page 1 of 1

DUT subtitles instead NLD

Posted: 10 Jun 2014, 19:46
by f3bruary
The Netherlands has two 3 digit language codes, NLD and DUT. Filebot writes to NLD but Plex cannot identify this. It will identify DUT however so my question is whether I can make filebot use the other variant (DUT) instead of NLD

Re: DUT subtitles instead NLD

Posted: 11 Jun 2014, 01:42
by rednoah
1.
Both codes make sense, report that as a bug with Plex and see if they can fix it.

NLD is the standard, the latest standard anyway:
http://en.wikipedia.org/wiki/ISO_639-3

2.
Use a generic regex renamer to replace NLD/DUT
http://www.filebot.net/forums/viewtopic ... &t=5#p2100

Re: DUT subtitles instead NLD

Posted: 11 Jun 2014, 09:28
by f3bruary
1. I will but I'm expecting a similar answer as this.

2. I am at the moment, but the less 'human intervention' the better.

UPDATE: Just found an issue with this. If I rename *.nld.srt to *.dut.srt. The next time filebot passes over my media, the -get-missing-subtitles becomes useless cause it won't detect .dut as existing dutch subtitle. It will fetch subs again.

Re: DUT subtitles instead NLD

Posted: 11 Jun 2014, 15:05
by rednoah
ISO 639-2/B data is not available in the Java I18N module.

EDIT:
hardcoded all the ISO 639-2/B mapping into r2252

Re: DUT subtitles instead NLD

Posted: 11 Jun 2014, 19:12
by f3bruary
thanks. Is this in order to detect existing .dut subtitles ? or will this enable me to write to .dut ?

UPDATE: Just ran it and it ignored the existing .dut.srt and fetched .nld.srt anyways. This is version r2252

UPDATE2: It seemed to have ignored .nl.srt subtitles too. Could it be that there's something wrong with this version ?

Re: DUT subtitles instead NLD

Posted: 12 Jun 2014, 02:32
by rednoah
This is in order to help FileBot understand ISO 639-2/B codes, but FileBot will only ever write ISO 639-3 because somebody needs to start using the standard.

So you have any logs?

Because I do have logs, and it works:

Code: Select all

[admin@DiskStation /volume1/data/test]$ filebot -get-missing-subtitles "Avatar.avi" --lang nld
Get [Dutch] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
Matched [Avatar.avi] to [m-avatar-a] via hash
Fetching [m-avatar-a.srt]
Writing [m-avatar-a.srt] to [Avatar.nld.srt]
Done ヾ(@⌒ー⌒@)ノ

Code: Select all

[admin@DiskStation /volume1/data/test]$ mv Avatar.nld.srt Avatar.dut.srt

Code: Select all

[admin@DiskStation /volume1/data/test]$ filebot -get-missing-subtitles "Avatar.avi" --lang nld
No missing subtitles
Done ヾ(@⌒ー⌒@)ノ

Re: DUT subtitles instead NLD

Posted: 12 Jun 2014, 09:43
by f3bruary
It seems to work when I do it manually. But the cronjob still fetches subtitles anyways. I'll look into it

Re: DUT subtitles instead NLD

Posted: 13 Jun 2014, 10:04
by f3bruary
I have the following script set up to run once a day.

#!/bin/sh


filebot -get-missing-subtitles --lang tr --output srt --encoding utf8 /volume1/video/movies/*
filebot -get-missing-subtitles --lang en --output srt /volume1/video/movies/*
filebot -get-missing-subtitles --lang nl --output srt /volume1/video/movies/*
#find /volume1/video/movies -iname '*.nld.srt' -exec rename 's/nld\.srt/dut\.srt/g' {} \;

exit

------------------------
Last night, it fetched all the .nld.srt subs again and I don't get why. Is there something wrong with the command I use ? It works properly when I run it outside the script on the command line.

UPDATE: Just ran the script and it does work propely. Yet when it's autostarted at midnight, it fetches all these .nld.srt subs anyways, I don't get it

Re: DUT subtitles instead NLD

Posted: 13 Jun 2014, 11:37
by rednoah
Does it work if you call it on the folder rather than the file array?

Code: Select all

filebot -get-missing-subtitles --lang en --output srt /volume1/video/movies/
Only difference I can think of, it shouldn't make a difference how the script is called, it's still the same logic. Unless somehow you have an older version of filebot lying around as well that somehow gets called instead.

Re: DUT subtitles instead NLD

Posted: 13 Jun 2014, 14:56
by f3bruary
I ran the following.

Code: Select all

thegibson> time filebot -get-missing-subtitles --lang nl --output srt /volume1/video/movies/
No missing subtitles
Done ヾ(@⌒ー⌒@)ノ
real    0m 6.98s
user    0m 6.69s
sys     0m 0.27s

thegibson> time filebot -get-missing-subtitles --lang nl --output srt /volume1/video/movies/*
Get [Dutch] subtitles for 53 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: /volume1/video/movies/310 to Yuma (2007)/310 to Yuma.mkv
...SNIP...
No matching subtitles found: /volume1/video/movies/Yol (1982)/Yol.avi
Done ヾ(@⌒ー⌒@)ノ
real    5m 42.97s
user    5m 10.30s
sys     0m 4.64s
It seems the first command just checks the main folder and does not recurse. The 2nd command that contains the wildcard does work. Like I said, I can run the commands fine and also the script. It's just when at midnight the script is called, it somehow downloads unneeded subs anyways. I do have a backup FileBot.jar.bak from the previous version but I doubt it gets called. I'll delete it anyways....

Some more info:

Code: Select all

thegibson> which filebot
/opt/bin/filebot

thegibson> cat /opt/bin/filebot
#!/bin/sh

# force JVM language and encoding settings
export LANG=en_US.utf8

java -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dapplication.deployment=ipkg -Dapplication.analytics=true -Duser.home=/opt/share/filebot/data -Dapplication.dir=/opt/share/filebot/data -Djava.io.tmpdir=/opt/share/filebot/data/temp -Djna.library.path=/opt/share/filebot -Djava.library.path=/opt/share/filebot -Dnet.filebot.AcoustID.fpcalc=/opt/share/filebot/fpcalc -jar /opt/share/filebot/FileBot.jar "$@"

thegibson> java -jar /opt/share/filebot/FileBot.jar -help
FileBot 4.1 (r2252) / Java(TM) SE Embedded Runtime Environment 1.8.0 (headless)

 --action [move, copy, keeplink,        : Rename action
 symlink, hardlink, test]
 --conflict [override, skip, fail]      : Conflict resolution
 --db [TVRage, AniDB, TheTVDB] or       : Episode/Movie database
--SNIP---

Re: DUT subtitles instead NLD

Posted: 13 Jun 2014, 15:42
by rednoah
1.
If you want to process a folder tree you need to set -r flag

2.
If you use * shell expansion you effectively pass in all files and folders, i.e. lots of folder arguments, it's still not recursive though

Code: Select all

/volume1/video/movies/*
3.
If you run -get-subtitles repeatedly on the same folder you need to use this script and set --def maxAgeDays
http://www.filebot.net/forums/viewtopic ... 8871#p8871

Re: DUT subtitles instead NLD

Posted: 13 Jun 2014, 21:29
by f3bruary
I changed the script and removed the * and added -r. I'll let you know if it's working properly now.

I'd use the maxAgeDays parameter, but sometimes older movies are still missing subs and eventually they get fetched too. So I want to ignore that for now. Filebot first checks if there are subs needed right ? So only the folders that still need subs will be queried at opensubtitles.org, right ?

Re: DUT subtitles instead NLD

Posted: 14 Jun 2014, 10:13
by f3bruary
Ok, it seems to work fine now. Don't know exactly what fixed it though but thanks for the help