Can AMC filter Chinese Character?

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
xuewy
Posts: 13
Joined: 06 Mar 2019, 14:06

Can AMC filter Chinese Character?

Post by xuewy » 06 Mar 2019, 14:20

I am from China, the file I downloaded generally include Chinese Character+English, e.g 行尸走肉.The Walking Dead.S01E01.mp4. When I run AMC script, the query result already identified it's a TV and [group]=[行尸走肉. The walking dead], but as it include Chinese character, theTVDB or TVmaze could not find the proper data and rename the file. I just want to know if AMC script can use some parameters to remove the Chinese Character just keeping the English ones.

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

Re: Can AMC filter Chinese Character?

Post by rednoah » 07 Mar 2019, 04:20

1.
Please share your filebot command and console output so we can see what's going on.

:idea: viewtopic.php?f=5&t=1868


2.
The Chinese alias is perfectly fine, and might possibly even help identify the files:

Code: Select all

$ filebot -list --q 行尸走肉
The Walking Dead - 1x01 - Days Gone Bye
The Walking Dead - 1x02 - Guts
The Walking Dead - 1x03 - Tell It to the Frogs
...

3.
Please run filebot -script fn:sysinfo and post the output.
:idea: Please read the FAQ and How to Request Help.

xuewy
Posts: 13
Joined: 06 Mar 2019, 14:06

Re: Can AMC filter Chinese Character?

Post by xuewy » 07 Mar 2019, 08:39

1. I use below command

Code: Select all

filebot -script /root/scripts/amc.groovy "/share/Complete/Temp" --output "/share/Complete" --action duplicate --conflict skip -non-strict  --log all --log-file amc.log -no-xattr --def unsorted=y excludeList=amc.txt seriesFormat="{plex}" movieFormat="{plex}" clean=y
2. As in CN, I could not connect to TheTVDB, so I changed the db to TVmaze in amc.groovy, below is the log result:

Code: Select all

Run script [/root/scripts/amc.groovy] at [Thu Mar 07 08:11:43 UTC 2019]
Parameter: unsorted = y
Parameter: excludeList = amc.txt
Parameter: seriesFormat = {plex}
Parameter: movieFormat = {plex}
Argument[0]: /share/Complete/Temp
Use excludes: /share/Complete/amc.txt
Input: /share/Complete/Temp/行尸走肉.The.Walking.Dead.S09E12.中英字幕.WEBrip.720P-人人影视.mp4
Group: [tvs:行尸走肉] => [行尸走肉.The.Walking.Dead.S09E12.中英字幕.WEBrip.720P-人人影视.mp4]
Rename episodes using [TVmaze]
Auto-detected query: [行尸走肉, 行尸走肉 the walking dead]
Failed to fetch episode data: [行尸走肉, 行尸走肉 the walking dead]
CmdlineException: Failed to match files to episode data
Processing 1 unsorted files
Skipped [/share/Complete/Temp/行尸走肉.The.Walking.Dead.S09E12.中英字幕.WEBrip.720P-人人影视.mp4] because [/share/Complete/Unsorted/行尸走肉.The.Walking.Dead.S09E12.中英字幕.WEBrip.720P-人人影视.mp4] already exists
Processed 0 files
Finished without processing any files
I think maybe it's the TVmaze DB do not support Chinese very well, as the "Auto-detected query: [行尸走肉, 行尸走肉 the walking dead]" contains Chinese character, it lost direction. If I remove 行尸走肉, it works. you can find the log:

Code: Select all

Run script [/root/scripts/amc.groovy] at [Thu Mar 07 08:44:10 UTC 2019]
Parameter: unsorted = y
Parameter: excludeList = amc.txt
Parameter: seriesFormat = {plex}
Parameter: movieFormat = {plex}
Argument[0]: /share/Complete/Temp
Use excludes: /share/Complete/amc.txt
Input: /share/Complete/Temp/The.Walking.Dead.S09E12.中英字幕.WEBrip.720P-人人影视.mp4
Group: [tvs:the walking dead] => [The.Walking.Dead.S09E12.中英字幕.WEBrip.720P-人人影视.mp4]
Rename episodes using [TVmaze]
Auto-detected query: [The Walking Dead]
Fetching episode data for [The Walking Dead]
Fetching episode data for [Fear the Walking Dead]
Fetching episode data for [The Walking Dead: The Oath]
Fetching episode data for [Talking Dead]
Fetching episode data for [The Walking Dead: Torn Apart]
[DUPLICATE] From [/share/Complete/Temp/The.Walking.Dead.S09E12.中英字幕.WEBrip.720P-人人影视.mp4] to [/share/Complete/TV Shows/The Walking Dead/Season 09/The Walking Dead - S09E12 - Guardians.mp4]
Processed 1 files

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

Re: Can AMC filter Chinese Character?

Post by rednoah » 07 Mar 2019, 09:20

1.
I see. FileBot is heavily optimized for TheTVDB and has a lot of FileBot-specific workaround to make TheTVDB work well, the amc script in turn is optimized for and exclusively tested with the default data sources (hence no standard options to change that).


2.
The best solution is to somehow make TheTVDB work. Either via proxy, or VPN tunnel, or private mirror.


3.
If you do choose to pre-process files to strip Hanzi from the filename, then filebot can help with that too:

Code: Select all

filebot -rename *.mp4 --db file --format "{fn.removeAll(/\p{script=Han}/).space(/ /)}"
[MOVE] from [行尸走肉.The.Walking.Dead.S09E12.中英字幕.WEBrip.720P-人人影视.mp4] to [The Walking Dead S09E12 WEBrip 720P-.mp4]
:idea: Please read the FAQ and How to Request Help.

xuewy
Posts: 13
Joined: 06 Mar 2019, 14:06

Re: Can AMC filter Chinese Character?

Post by xuewy » 07 Mar 2019, 13:17

Thanks a lot for the fast response. I think maybe pre-process is a workaround.
I also studied the amc.groovy a little bit, I think it first judge if the file is a tv or a movie,then query the episode or movie data according to the defined DB.
so you can find the input of the Auto-detected query is [行尸走肉, 行尸走肉 the walking dead], I just wondering how it get such a result, is that possible to modify some parameters in the query like what you described in pre-process way to remove Han, to turn the result of Auto-detected query to [the walking dead], then it should be worked.
I also have another question, what's the query mechanism for Filebot working, is the File name scan as first priority? I think if a file named as 2018.HD.mp4, can filebot get its correct mediainfo? I believe Filebot can scan some built-in properties of the file, such as hash, language, audio, resolution etc. If it is true, then we can bypass the name and use other way to find the correct File information(include the file name) then we can use -rename to get the correct file names, is that possible and how to do?

BR!

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

Re: Can AMC filter Chinese Character?

Post by rednoah » 07 Mar 2019, 14:37

1.
You won't find filebot internals in the amc script. The amc script merely glues together filebot calls. You can modify the script, but you can't modify the functions that are called by the script.


2.
When identifying the Movie or Episode a file refers to, then FileBot uses everything, and picks the best option based on all available information.

Reading MediaInfo from the file contents (e.g. video codec) is completely unrelated to identify movies / episodes based on the filename.
viewtopic.php?f=5&t=4285

Reading MediaInfo indeed does not require the file to be identified as anything.

e.g. you can just add video codec / audio codec to existing file names instantly like this:

Code: Select all

filebot -rename *.mp4 --db file --format "{fn}.{vc}.{ac}"
:idea: Please read the FAQ and How to Request Help.

Post Reply