Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

digit at the start of the title of a single episode misinterpreted as a range of episodes #752

Open
jcfp opened this issue Aug 15, 2023 · 0 comments

Comments

@jcfp
Copy link

jcfp commented Aug 15, 2023

hi,

a recent bug (sabnzbd/sabnzbd#2654) filed against sabnzbd showed guessit wrongly identify a digit at the start of an episode title as a range of episodes:

Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import guessit
>>> guessit.__version__
'3.7.1'
>>> guessit.api.guessit('Show.Name.1969.S01E02.2.Kings.1080p.DDP5.1.H.264')
MatchesDict([('title', 'Show Name'), ('year', 1969), ('season', 1), ('episode', 2), ('episode_title', '2 Kings'), ('screen_size', '1080p'), ('audio_codec', 'Dolby Digital Plus'), ('audio_channels', '5.1'), ('video_codec', 'H.264'), ('type', 'episode')])
>>> guessit.api.guessit('Show.Name.1969.S01E02.3.Kings.1080p.DDP5.1.H.264')
MatchesDict([('title', 'Show Name'), ('year', 1969), ('season', 1), ('episode', [2, 3]), ('episode_title', 'Kings'), ('screen_size', '1080p'), ('audio_codec', 'Dolby Digital Plus'), ('audio_channels', '5.1'), ('video_codec', 'H.264'), ('type', 'episode')])
>>> guessit.api.guessit('Show.Name.1969.S01E02.4.Kings.1080p.DDP5.1.H.264')
MatchesDict([('title', 'Show Name'), ('year', 1969), ('season', 1), ('episode', [2, 4]), ('episode_title', 'Kings'), ('screen_size', '1080p'), ('audio_codec', 'Dolby Digital Plus'), ('audio_channels', '5.1'), ('video_codec', 'H.264'), ('type', 'episode')])
>>> guessit.api.guessit('Show.Name.1969.S01E02.5.Kings.1080p.DDP5.1.H.264')
MatchesDict([('title', 'Show Name'), ('year', 1969), ('season', 1), ('episode', 2), ('episode_title', '5 Kings'), ('screen_size', '1080p'), ('audio_codec', 'Dolby Digital Plus'), ('audio_channels', '5.1'), ('video_codec', 'H.264'), ('type', 'episode')])

This handling seems to be deliberate, as it only triggers if the far end of the episode range is a maximum of 2 positions away from the initial (actual) episode number.

The very presence of an episode title doesn't make sense in case of multiple episodes (as these would generally each have their own title) and therefore could be used as a counter-indication for interpreting the number at the start of the episode title as a 'range of episodes'. That is, guessit should not apply this range style handling in the presence of an episode title, and thus correctly identify titles such as Show.Name.1969.S01E02.4.Kings.1080p.DDP5.1.H.264 as a single episode titled '4 Kings'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant