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
824 stars 92 forks source link

Not parsing leading episode number in anime #747

Open johnpyp opened 1 year ago

johnpyp commented 1 year ago

Leading episode number in anime file gets parsed as part of the title rather than the episode when the episode number is a single digit.

Examples:

guessit "22. Nanatsu no Taizai - The Seven Deadly Sins [1080 Hi10p AAC][kuchikirukia].mkv"

For: 22. Nanatsu no Taizai - The Seven Deadly Sins [1080 Hi10p AAC][kuchikirukia].mkv
GuessIt found: {
    "episode": 22,
    "title": "Nanatsu no Taizai",
    "episode_title": "The Seven Deadly Sins",
    "screen_size": "1080p",
    "video_profile": "High 10",
    "color_depth": "10-bit",
    "audio_codec": "AAC",
    "release_group": "kuchikirukia",
    "container": "mkv",
    "type": "episode"
}

With a single digit leading number, it instead parses it as a movie:

guessit "5. Nanatsu no Taizai - The Seven Deadly Sins [1080 Hi10p AAC][kuchikirukia].mkv"

For: 5. Nanatsu no Taizai - The Seven Deadly Sins [1080 Hi10p AAC][kuchikirukia].mkv
GuessIt found: {
    "title": "5 Nanatsu no Taizai",
    "alternative_title": "The Seven Deadly Sins",
    "screen_size": "1080p",
    "video_profile": "High 10",
    "color_depth": "10-bit",
    "audio_codec": "AAC",
    "release_group": "kuchikirukia",
    "container": "mkv",
    "type": "movie"
}

Explicitly passing -t episode doesn't help unfortunately:

guessit -t episode "5. Nanatsu no Taizai - The Seven Deadly Sins [1080 Hi10p AAC][kuchikirukia].mkv"

For: 5. Nanatsu no Taizai - The Seven Deadly Sins [1080 Hi10p AAC][kuchikirukia].mkv
GuessIt found: {
    "title": "5 Nanatsu no Taizai",
    "alternative_title": "The Seven Deadly Sins",
    "screen_size": "1080p",
    "video_profile": "High 10",
    "color_depth": "10-bit",
    "audio_codec": "AAC",
    "release_group": "kuchikirukia",
    "container": "mkv",
    "type": "episode"
}
VeNoMouS commented 1 year ago

I looked into what caused this,

https://github.com/guessit-io/guessit/blob/develop/guessit/rules/properties/episodes.py#L860

This is occurring as it's being detected as a "weak-episode" and its >= 10

@Toilal