Sharing Script: Move [Release Group] anime (Series/Specials/Movies) using AniDB metadata to Series/Season folders

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
rv23
Posts: 64
Joined: 19 Jul 2020, 15:05

Sharing Script: Move [Release Group] anime (Series/Specials/Movies) using AniDB metadata to Series/Season folders

Post by rv23 »

I am posting a script that I have been working on for the last 6 months that suits a very very specific use case, but might have some value to other's if they also have this same use case.

The Code is here: https://github.com/runecalico/filebot-public

What is my use case?
I shotgun download Anime from a multitude of Release Groups, to the tune of thousands of files a week.
I do not have the desire nor the time to manually sort them, and I ultimately use AniDB to track and sort my Collection (30%+ of AniDB)
Filebot & AMC are great tools, and everything considered work very very well.
I however wanted to use AniDB metadata, and for the initial sorting of the incoming files I have no interest in FILE renaming, just sorting them into the "correct" Series/Season as per AniDB. Movies and OVA/ONA etc included.
AMC in strict mode produces an acceptable amount of "incorrect" matches, but an unacceptable (to me) total amount of what *is* matched.
AMC in Non-Strict mode produces an unacceptable (to me) amount of "incorrect" matches, but matches almost everything.
You can Forget about AniDB for movies, and OVA/ONA/OAD often don't match either.
I needed something to sort the raw incoming files with "high" accuracy (additional stages will be used to prune the files down to what I want to keep or add to AniDB)

What does the script do?
It tries to take the filename and from it, produce an likely match to AniDB (and TVDB), and then perform a rename. The "Default" rename format doesn't rename the file, but places it in a directory that hopefully has the AniDB metadata and AID in the directory name (there are still some issues using TVDB for lookups but expecting AniDB metadata).

Code: Select all

movieFormat    = any { movieFormat    } { _args.format } { '{ \'movies\' }/\n' +
    '    { any { db.AniDB.n.replaceAll(/\\\\|\\//, \'\') } { db.AniDB.primaryTitle.replaceAll(/\\\\|\\//, \'\') } { db.TheTVDB.n.colon(\' - \').replaceTrailingBrackets().replaceAll(/\\\\|\\//, \'\') } { n.replaceAll(/\\\\|\\//, \'\') } }\n' +
    '    { any { if (db.AniDB.id) \'[anidb-\' + { db.AniDB.id } + \']\' } { if (order.airdate.db.AniDB.id) \'[anidb-\' + { order.airdate.db.AniDB.id } + \']\' } { if (order.absolute.db.AniDB.id) \'[anidb-\' + { order.absolute.db.AniDB.id } + \']\' } { \'[tvdb-\' + db.TheTVDB.id + \']\' } { \'[tmdb-\' + tmdbid + \']\' } }\n' +
    '/ { fn }' }
I also try to do this for Movies and "Specials".

Does it work?
It Minimally meets the my initial requirements.
  • It supports Series, Specials and Movies
    It matches more then AMC Strict, but less the AMC Non-Strict
    It has an acceptable number of false matches
    It uses AniDB exclusively for Movies, and tries to use TVDB only when I think Filebot can map the data to AniDB (this part needs work)
    It also has greatly reduced AniDB usage due to local usage of several files for Title "matching" (Aka I get the AniDB Ban Hammer *less* then with AMC because it only requests episodes for specific series)
Last edited by rv23 on 24 Dec 2020, 22:56, edited 1 time in total.
rv23
Posts: 64
Joined: 19 Jul 2020, 15:05

Re: Sharing Script: Move [Release Group] anime using AniDB metadata to Series/Season folders

Post by rv23 »

oh.. and the code is ...
UGLY and CRAP ..
But mostly works :)
rv23
Posts: 64
Joined: 19 Jul 2020, 15:05

Re: Sharing Script: Move [Release Group] anime (Series/Specials/Movies) using AniDB metadata to Series/Season folders

Post by rv23 »

While not a measure of comparison, nor a good test of "in the wild", but at least as a way of indicating it meets my requirements.
A recent run of the script to process 7924 files (most of the files relating to the 2020 Fall Anime Season) resulted in the following using Filebot's Strict mode and this script.
7827 files were moved into directories corresponding to their correct Anime Series and date (I sort it into the seasons, so I know they should be all 2020 Fall Anime Season).
However filebot either did not match the episode correctly, or did not have valid date data for 90 of them as they were not placed in the 2020 Fall Anime Season. (Mostly long running shows like Black Clover, Case Closed and Boruto Naruto Next Generations)
70 files didn't get moved.

Overall I consider this to meet my requirements. Match more then AMC on Strict, Have same or less incorrect matches as AMC on Strict, but have more overall moves much like AMC Non-Strict.
Post Reply