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

Wrong Guess with titles with "-" in them? #690

Open XxUnkn0wnxX opened 3 years ago

XxUnkn0wnxX commented 3 years ago

Hi I'm using Medusa (Dev Branch) & some of my downloads have been failing due to guessit getting season value wrong..

Report 1

XxUnkn0wnxXiMac tests % python3 report_guessit.py "[Golumpa] Re ZERO -Starting Life in Another World- Season 2 - 15 [CR-Dub 1080p x264 AAC] [5CA99EB6].mkv" "Re ZERO -Starting Life in Another World- Season 2"
# guessit: 3.3.1  rebulk: 3.0.1
# show list: ['Re ZERO -Starting Life in Another World- Season 2']
? [Golumpa] Re ZERO -Starting Life in Another World- Season 2 - 15 [CR-Dub 1080p x264 AAC] [5CA99EB6].mkv
  release_group: Golumpa
  title: Re ZERO -Starting Life in Another World- Season 2
  season: 15
  language: und
  screen_size: 1080p
  video_codec: H.264
  video_encoder: x264
  audio_codec: AAC
  crc32: 5CA99EB6
  container: mkv
  mimetype: video/x-matroska
  type: episode
  parsing_time: 0.042375802993774414

I get a file download with a name like [Golumpa] Re ZERO -Starting Life in Another World- Season 2 - 15 [CR-Dub 1080p x264 AAC] [5CA99EB6].mkv & the scene name is Re ZERO -Starting Life in Another World- Season 2 or Re ZERO -Starting Life in Another World- but guessit see's it as S15? episodes with a Dash then a value after it usually indicates episode value not season value...

Report 2: (with a more full path)

XxUnkn0wnxXiMac tests % python3 report_guessit.py "/AppDL/medusa-m/[Golumpa] Re ZERO -Starting Life in Another World- Season 2 - 15 [CR-Dub 1080p x264 AAC] [5CA99EB6].mkv/[Golumpa] Re ZERO -Starting Life in Another World- Season 2 - 15 [CR-Dub 1080p x264 AAC] [5CA99EB6].mkv" "Re ZERO -Starting Life in Another World- Season 2"
# guessit: 3.3.1  rebulk: 3.0.1
# show list: ['Re ZERO -Starting Life in Another World- Season 2']
? /AppDL/medusa-m/[Golumpa] Re ZERO -Starting Life in Another World- Season 2 - 15 [CR-Dub 1080p x264 AAC] [5CA99EB6].mkv/[Golumpa] Re ZERO -Starting Life in Another World- Season 2 - 15 [CR-Dub 1080p x264 AAC] [5CA99EB6].mkv
  release_group: Golumpa
  title: Re ZERO -Starting Life in Another World- Season 2
  season: 15
  language: und
  screen_size: 1080p
  video_codec: H.264
  video_encoder: x264
  audio_codec: AAC
  crc32: 5CA99EB6
  container: mkv
  mimetype: video/x-matroska
  type: episode
  parsing_time: 0.08508801460266113
Toilal commented 3 years ago

It generates a list for season.

For: [Golumpa] Re ZERO -Starting Life in Another World- Season 2 - 15 [CR-Dub 1080p x264 AAC] [5CA99EB6].mkv
GuessIt found: {
    "release_group": "Golumpa",
    "title": "Re ZERO",
    "episode_title": "Starting Life in Another World",
    "season": [
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15
    ],
    "language": "und",
    "screen_size": "1080p",
    "video_codec": "H.264",
    "audio_codec": "AAC",
    "crc32": "5CA99EB6",
    "container": "mkv",
    "mimetype": "video/x-matroska",
    "type": "episode"
}

This is expected ... What is 15 supposed to be ? Episode number ?

p0psicles commented 2 years ago

Yes 15 is the episode number. Here is a similar one: [Tsundere-Raws] Tate no Yuusha no Nariagari Season 2 - 03 VOSTFR (CR) [WEB 720p x264 AAC].mkv Here expected:

titel: Tate no Yuusha no Nariagari Season 2
episode: 3
p0psicles commented 2 years ago

@Toilal i could write a rebulk rule to fix it. But isn't it possible for guessit to fix this, or would that break other multi-season releases?

Toilal commented 2 years ago

I'm not sure ... I'll be OK with a pull request if existing tests pass properly.

zoriya commented 5 months ago

@p0psicles Sorry to ping on an old issue, but I saw you implemented the rebulk rule in Medusa (via https://github.com/pymedusa/Medusa/pull/10534), is there a reason this was not upstreamed here?

I also quickly looked at currents tests that would fail if this was implemented, and I see some like:

? Something.Other.Season.1-3.avi
: season: [1, 2, 3]
  title: Something Other

but I don't really understand this test case, are there real video files containing multiples complete seasons?

PS:

Also a thing to note, S3 and Season 3 are handled differently in this case.

guessit '[SubsPlease] Mob Psycho 100 S3 - 12 (1080p) [E5058D7B].mkv'
For: [SubsPlease] Mob Psycho 100 S3 - 12 (1080p) [E5058D7B].mkv
GuessIt found: {
    "release_group": "SubsPlease",
    "title": "Mob Psycho 100",
    "season": 3,
    "episode_title": "12",
    "screen_size": "1080p",
    "crc32": "E5058D7B",
    "container": "mkv",
    "mimetype": "video/x-matroska",
    "type": "episode"
}

but

guessit '[SubsPlease] Mob Psycho 100 Season 3 - 12 (1080p) [E5058D7B].mkv'
For: [SubsPlease] Mob Psycho 100 Season 3 - 12 (1080p) [E5058D7B].mkv
GuessIt found: {
    "release_group": "SubsPlease",
    "title": "Mob Psycho",
    "episode": 100,
    "season": [
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12
    ],
    "screen_size": "1080p",
    "crc32": "E5058D7B",
    "container": "mkv",
    "mimetype": "video/x-matroska",
    "type": "episode"
}