Page 1 of 1

Weird result using CLI

Posted: 30 Mar 2017, 15:31
by saitoh183
So i use Filebot in my script for anime and overall it works well. But today i had a weird issue and i dont know why it acted this way.

i had a anime in
/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]

inside is episodes 1 to 12 all in the format
[AnimeRG] Berserk (2016) - 01 [1080p] [Multi-Sub] [x265] [pseudo].mkv

the filbot CLI i run is

Code: Select all

filebot -script fn:amc -non-strict /mnt/sde1/Downloads/Torrents/Anime --log-file "/mnt/sde1/logs/Filebot.log" --action move --def clean=y -no-xattr --log=Fine --def animeFormat=/mnt/sde1/Downloads/importing/Anime/{primaryTitle}/{primaryTitle} - {absolute} - {t} [{group}] --def ut_label=Anime --def exec= \"\"python /mnt/sde1/Scripts/animemove.py -ani \"{primaryTitle}\" '+dbug+'\"\"
The output uses TVDB to rename instead of Anidb

Code: Select all

Run script [fn:amc] at [Thu Mar 30 08:49:16 EDT 2017]
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 01 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 02 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 03 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 04 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 05 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 06 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 07 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 08 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 09 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 10 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 11 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 12 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Rename episodes using [TheTVDB]
Auto-detected query: [Berserk 2016, berserk]
Fetching episode data for [Berserk (2016)]
Fetching episode data for [Berserk]
Fetching episode data for [Berserk - The Road to Valhalla]
Fetching episode data for [Berserk towards the South Pole]
Fetching episode data for [Berserk towards the North Pole]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 01 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 01/Berserk (2016) - S01E06 - A Nighttime Feast - Burning at the Stake.mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 02 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 02/Berserk (2016) - S02E01 - Episode 1.mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 03 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 01/Berserk (2016) - S01E10 - Hell's Angels.mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 04 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 01/Berserk (2016) - S01E04 - Revelations.mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 05 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 01/Berserk (2016) - S01E05 - Tower of Conviction.mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 06 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 01/Berserk (2016) - S01E11 - Shadows of Ideas.mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 07 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 01/Berserk (2016) - S01E07 - The Black Witch.mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 08 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 01/Berserk (2016) - S01E08 - Reunion in the Den of Evil.mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 09 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 01/Berserk (2016) - S01E01 - The Branded Swordsman.mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 10 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 01/Berserk (2016) - S01E02 - The Holy Iron Chain Knights.mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 11 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 01/Berserk (2016) - S01E03 - Night of Miracles.mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/[AnimeRG] Berserk (2016) - 12 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) Complete Season 01 (EP 01-12) [1080p] [Multi-Sub] [Batch] [x265] [pseudo]/TV Shows/Berserk (2016)/Season 01/Berserk (2016) - S01E12 - Those Who Cling, Those Who Struggle.mkv]
Processed 12 files
Execute: ""python /mnt/sde1/Scripts/animemove.py -ani "Berserk (2016)" -v""
Clean clutter files and empty folders
But if i just put a single episode in the process folder , i get the desired behavior

Code: Select all

Run script [fn:amc] at [Thu Mar 30 11:07:39 EDT 2017]
Input: /mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) - 01 [1080p] [Multi-Sub] [x265] [pseudo].mkv
Rename episodes using [AniDB]
Auto-detected query: [Berserk 2016]
Fetching episode data for [Berserk]
Fetching episode data for [Berserk (2017)]
Fetching episode data for [Kenpuu Denki Berserk]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[AnimeRG] Berserk (2016) - 01 [1080p] [Multi-Sub] [x265] [pseudo].mkv] to [/mnt/sde1/Downloads/importing/Anime/Berserk/Berserk - 1 - The Branded Swordsman [].mkv]
Processed 1 files
Execute: ""python /mnt/sde1/Scripts/animemove.py -ani "Berserk" -v""
Clean clutter files and empty folders
How come?

Re: Weird result using CLI

Posted: 30 Mar 2017, 18:43
by rednoah
Looks like EP 01-12 is interpreted as multi-episode pattern, kinda like S01E01-E12 would be, so FileBot will match each single file to all episodes, and the rest is just random.

Re: Weird result using CLI

Posted: 30 Mar 2017, 19:03
by saitoh183
rednoah wrote:Looks like EP 01-12 is interpreted as multi-episode pattern, kinda like S01E01-E12 would be, so FileBot will match each single file to all episodes, and the rest is just random.
Ok, good to know so i can watch out for next time.

Re: Weird result using CLI

Posted: 30 Mar 2017, 19:27
by rednoah
I'll add an additional sanity check. Fixed with r4965.

Re: Weird result using CLI

Posted: 30 Mar 2017, 19:37
by saitoh183
rednoah wrote:I'll add an additional sanity check. Fixed with r4965.
Good stuff i will test it later tonight

Re: Weird result using CLI

Posted: 18 Apr 2017, 20:08
by saitoh183
saitoh183 wrote:
rednoah wrote:I'll add an additional sanity check. Fixed with r4965.
Good stuff i will test it later tonight
does that revision also apply for this:

Code: Select all

Run script [fn:amc] at [Tue Apr 18 13:40:07 EDT 2017]
Parameter: clean = y
Parameter: animeFormat = /mnt/sde1/Downloads/importing/Anime/{primaryTitle}/{primaryTitle} - {absolute} - {t} [{group}]
Parameter: ut_label = Anime
Parameter: exec =  ""python /mnt/sde1/Scripts/animemove.py -ani "{primaryTitle}" -v""
Argument[0]: /mnt/sde1/Downloads/Torrents/Anime
Input: /mnt/sde1/Downloads/Torrents/Anime/[Commie] Macross Frontier the Movie ~Itsuwari no Utahime~ [BD 720p AAC] [E6A9D954].mkv
Group: [mov:macross frontier the false songstress 2009] => [[Commie] Macross Frontier the Movie ~Itsuwari no Utahime~ [BD 720p AAC] [E6A9D954].mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/mnt/sde1/Downloads/Torrents/Anime/[Commie] Macross Frontier the Movie ~Itsuwari no Utahime~ [BD 720p AAC] [E6A9D954].mkv]
[MOVE] From [/mnt/sde1/Downloads/Torrents/Anime/[Commie] Macross Frontier the Movie ~Itsuwari no Utahime~ [BD 720p AAC] [E6A9D954].mkv] to [/mnt/sde1/Downloads/Torrents/Anime/Movies/Macross Frontier - The False Songstress (2009)/Macross Frontier - The False Songstress (2009).mkv]
Processed 1 files
it is using TheMovieDB instead of Anidb

Re: Weird result using CLI

Posted: 18 Apr 2017, 21:19
by saitoh183
I tried with the latest HEAD release and i still get the problem the Macross file. I tried removing the words "the Movie" from the title but it still used TheMovieDB

Re: Weird result using CLI

Posted: 19 Apr 2017, 02:43
by rednoah
Please explain how this match is not correct:

Code: Select all

[Commie] Macross Frontier the Movie ~Itsuwari no Utahime~ [BD 720p AAC] [E6A9D954].mkv

Code: Select all

Macross Frontier - The False Songstress (2009).mkv
Itsuwari no Utahime could be translated as The False Songstress if my Japanese doesn't betray me. Looks good to me.

Re: Weird result using CLI

Posted: 19 Apr 2017, 12:05
by saitoh183
Yes, the match is correct if i wanted to use TheMovieDB, but i want it to use Anidb since it is anime and i set the ut_label to Anime and not Movie.
So the rename i want is

Code: Select all

Gekijouban Macross F: Itsuwari no Utahime - 1 - Complete Movie [Commie]

Re: Weird result using CLI

Posted: 19 Apr 2017, 12:32
by rednoah
1.
Looks like one of the "Force Movie" rules applies, which overrules any "Force Anime" rules.

2.
Even if you manage to force AniDB, it probably won't work well because AniDB is only supported in Series / Episode mode.

Re: Weird result using CLI

Posted: 19 Apr 2017, 12:45
by saitoh183
rednoah wrote:1.
Looks like one of the "Force Movie" rules applies, which overrules any "Force Anime" rules.

2.
Even if you manage to force AniDB, it probably won't work well because AniDB is only supported in Series / Episode mode.
I see, so the only option is to use the GUI, because the GUI works

Image

So CLI cant do what the GUI can do in this case?

Re: Weird result using CLI

Posted: 19 Apr 2017, 13:33
by saitoh183
Is there a reason you dont allow --db to override amc db choice? Having that would fix this issue in this case, im guessing. I cant just use the -rename because then i would lose -exec of amc.

Re: Weird result using CLI

Posted: 19 Apr 2017, 15:02
by rednoah
1.
Newer versions of the amc script force movie mode if the video file is longer than 100 minutes. That might be the rule that applies here. In this case, people might actually prefer TheMovieDB over AniDB because this is in fact a movie. Might be a bug. Might be a feature. Depends on the situation.

In fact, when using AniDB, "movie type" anime shouldn't be listed in the search results at all, but that data is incomplete so some movies might show up.

This "movie" just happens to work because it's mapped to TheTVDB special episodes, so it doesn't get excluded like all the other movie-type anime:

Code: Select all

  <anime anidbid="6655" tvdbid="81086" defaulttvdbseason="0" imdbid="tt1548563">
    <name>Gekijouban Macross F: Itsuwari no Utahime</name>
    <mapping-list>
      <mapping anidbseason="1" tvdbseason="0">;1-4;</mapping>
    </mapping-list>
  </anime>
@see https://github.com/ScudLee/anime-lists


2.
If you set --db to override the database, which database should it override? The one used for TV shows, or the one used for movies, or the one used for Anime?


3.
Your --def exec call is very simple:

Code: Select all

python /mnt/sde1/Scripts/animemove.py -ani "{primaryTitle}" -v
If xattr is enabled, then you can just do something like this after processing the files with FileBot:

Code: Select all

filebot -mediainfo -r . --format "animemove -ani {quote primaryTitle}" | sh -x
@see viewtopic.php?f=4&t=4788

Re: Weird result using CLI

Posted: 19 Apr 2017, 15:55
by saitoh183
rednoah wrote:
In fact, when using AniDB, "movie type" anime shouldn't be listed in the search results at all, but that data is incomplete so some movies might show up.

This "movie" just happens to work because it's mapped to TheTVDB special episodes, so it doesn't get excluded like all the other movie-type anime:

Code: Select all

  <anime anidbid="6655" tvdbid="81086" defaulttvdbseason="0" imdbid="tt1548563">
    <name>Gekijouban Macross F: Itsuwari no Utahime</name>
    <mapping-list>
      <mapping anidbseason="1" tvdbseason="0">;1-4;</mapping>
    </mapping-list>
  </anime>
@see https://github.com/ScudLee/anime-lists

Most Anime Movies (if not all) are considered specials on TheTVDB when they are part of a TV series. I dont know when it is a standalone movie if is still in TVDB.
rednoah wrote:1.
Newer versions of the amc script force movie mode if the video file is longer than 100 minutes. That might be the rule that applies here. In this case, people might actually prefer TheMovieDB over AniDB because this is in fact a movie. Might be a bug. Might be a feature. Depends on the situation.
I did at first but found it annoying to have the movie seperate from the tv series in plex/emby when it was considered a special in the TVDB.
rednoah wrote: 2.
If you set --db to override the database, which database should it override? The one used for TV shows, or the one used for movies, or the one used for Anime?
Use --db to for it to use the db you specify and override your 100min rule.
rednoah wrote: If xattr is enabled, then you can just do something like this after processing the files with FileBot:
I dont have much experience with xattr usually i disable it cuz it caused errors (you suggested this to me in a previous thread). I would have to add a second filebot call to my script or replace my exec portion with everything after filebot in the command you posted?