guessit-io / guessit

GuessIt is a python library that extracts as much information as possible from a video filename.
https://guessit-io.github.io/guessit
GNU Lesser General Public License v3.0
814 stars 92 forks source link

Matching opening/ending sequences #705

Open aurieh opened 2 years ago

aurieh commented 2 years ago

Currently, opening/ending information is usually matched as the episode title. I propose adding a few properties to help distinguish full episodes from these types of extras:

It'd also be a good idea to update episodes.WeakConflictSolver#is_anime to check for extra_type, as this type of file seems to be pretty much exclusive to anime releases.

Filename examples (including descriptions) follow

[GHOST] Saga of Tanya the Evil - OP [BDRip 1920x1080 x264][FB85D2DA].mkv
  # opening
[FFF] Shingeki no Kyojin - OP02 [BD][1080p-FLAC][40D46701].mkv
  # opening, index 2
NC/[Asakura] Tensei Shitara Slime Datta Ken 2nd Season NCED [BDRip 1920x1080 x265 10bit FLAC].mkv
  # creditless opening
[Slysoft]_Citrus_-_NCED_[BD][h265-1080p_FLAC][9CED295F].mkv
  # creditless ending
[Coalgirls]_Bakemonogatari_OP4a_(1920x1080_Blu-ray_FLAC)_[AF4FF3CC].mkv
  # opening, index 4a
[Doki] Sakura Trick - NCED 2 (1280x720 Hi10P BD AAC) [7E32B749].mkv
  # creditless ending, index 2
Extras/Goblin Slayer - NCED - Gin no Kisei (1080p 10bit FLAC -KS-).mkv
  # creditless ending, title "Gin no Kisei"
Extras/Goblin Slayer - NCOP - Rightfully (1080p 10bit FLAC -KS-).mkv
  # creditless opening, title "Rightfully"
NC/[VCB-Studio] Ishuzoku Reviewers [NCED_EP12][Ma10p_1080p][x265_flac].mkv
  # creditless ending, episode 12
Miss Kobayashi's Dragon Maid (Kobayashi-san Chi no Maid Dragon) (2017) [kuchikirukia]/NCED.mkv
  # creditless ending
Fullmetal_Alchemist_Brotherhood_ED2v2_Clean_[BD_1080p][AtsA][0F81F8F7].mkv
  # creditless ending, index 2, version 2
Code_Geass_Creditless_OP5_[720p,BluRay,x264]_-_gg-THORA.mkv
  # creditless opening, index 5
Code Geass Lelouch of the Rebellion S01/S01 NCED #02v1 Hybrid.mkv
  # creditless ending, index 2, version 1
  # NOTE: I have no idea what "Hybrid" means here; it's not the title, so
  # current behavior of matching it as "other" seems to be acceptable
Bonus/[FLFL] Nisemonogatari ED1a [BDRip 1920x1080 HEVC FLAC].mkv
  # ending, index 1a

I'd be more than willing to implement this feature and submit a PR for it, but I'd like some input from the maintainers before I start working on it. I might also need some pointers to rules implementing behavior similar to that required for matching strings like ED2v2_Clean and Creditless_OP5 properly.

Toilal commented 2 years ago

Sorry for very late answer. I'm ok for those new properties.