jkwill87 / mnamer

media file renaming and organizing tool
https://pypi.org/project/mnamer
MIT License
800 stars 67 forks source link

Fails to find episode mid-season. #136

Open AnalogMan151 opened 3 years ago

AnalogMan151 commented 3 years ago

Running on a directory it finds and matches the first 17 episodes just fine, then fails for episodes 18-24. So far this has only happened on this one specific series, I have been able to successfully process other series greater than 17 episodes. This also happens when specifying the TVDB ID manually. This only happens with TVDB, works fine with TVMaze.

D:\Pending Encodes>mnamer -r -b -v --id-tvdb=377543 "P:\Anime\Jujutsu Kaisen"

system
 - date = 2021-03-30
 - platform = Windows-10-10.0.19041-SP0
 - arguments = ['-r', '-b', '-v', '--id-tvdb=377543', 'P:\\Anime\\Jujutsu Kaisen']
 - cache location = C:\Users\AnalogMan\AppData\Local\mnamer-py3.9.sql
 - python version = 3.9.0
 - mnamer version = 2.5.2
 - appdirs version = 1.4.4
 - babelfish version = 0.5.5-dev
 - guessit version = 3.2.0
 - requests version = 2.25.1
 - requests cache version = 0.5.2
 - teletype version = 1.1.0

settings
 - targets = [WindowsPath('P:/Anime/Jujutsu Kaisen')]
 - batch = True
 - lower = False
 - recurse = True
 - scene = False
 - verbose = True
 - hits = 5
 - ignore = ['.*sample.*', '^RARBG.*']
 - language = None
 - mask = ['.avi', '.m4v', '.mp4', '.mkv', '.ts', '.wmv']
 - no_guess = True
 - no_overwrite = True
 - no_style = False
 - movie_api = tmdb
 - movie_directory = None
 - movie_format = {name} ({year}){extension}
 - episode_api = tvdb
 - episode_directory = None
 - episode_format = {series}.S{season:02}E{episode:02} - {title}{extension}
 - version = False
 - clear_cache = False
 - config_dump = False
 - config_ignore = False
 - config_path = None
 - id_imdb = None
 - id_tmdb = None
 - id_tvdb = 377543
 - id_tvmaze = None
 - no_cache = False
 - media = None
 - test = False
 - api_key_omdb = None
 - api_key_tmdb = None
 - api_key_tvdb = None
 - api_key_tvmaze = None
 - replace_before = {}
 - replace_after = {'&': 'and', ';': ' -', '@': 'at', '[': '', ']': '', '(': '', ')': '', "'": '', '?': '_', '!': '_', ',': '', ':': ' -', '"': ''}

targets
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E01 - Ryoumen Sukuna.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E02 - For Myself.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E03 - Girl of Steel.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E04 - Curse Womb Must Die.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E05 - Curse Womb Must Die -II.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E06 - After Rain.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E07 - Assault.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E08 - Boredom.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E09 - Small Fry and Reverse Retribution.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E10 - Idle Transfiguration.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E11 - Narrow-Minded.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E12 - To You Someday.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E13 - Tomorrow.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E14 - Kyoto Sister School Exchange Event - Group Battle 0.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E15 - Kyoto Sister School Exchange Event - Group Battle 1.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E16 - Kyoto Sister School Exchange Event - Group Battle 2.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E17.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E18.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E19.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E20.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E21.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E22.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E23.mkv
 - \\DocKlokServer\media\Plex\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E24.mkv
Starting mnamer

Processing Episode "Jujutsu Kaisen.S01E01 - Ryoumen Sukuna.mkv" (305.54MB)
P:\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E01 - Ryoumen Sukuna.mkv
using tvdb

search parameters
 - container = .mkv
 - group = None
 - language = None
 - language_sub = None
 - quality = None
 - synopsis = None
 - media = episode
 - series = Jujutsu Kaisen
 - season = 1
 - episode = 1
 - date = None
 - title = None
 - id_tvdb = 377543
 - id_tvmaze = None
 - extension = .mkv

skipping (source and destination paths are the same)

... Repeat above for first 16 files ...

Processing Episode "Jujutsu Kaisen.S01E17.mkv" (494.98MB)
P:\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E17.mkv
using tvdb

search parameters
 - container = .mkv
 - group = None
 - language = None
 - language_sub = None
 - quality = None
 - synopsis = None
 - media = episode
 - series = Jujutsu Kaisen
 - season = 1
 - episode = 17
 - date = None
 - title = None
 - id_tvdb = 377543
 - id_tvmaze = None
 - extension = .mkv

moving to P:\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E17 - Kyoto Sister School Exchange Event - Group Battle 3.mkv
OK!

Processing Episode "Jujutsu Kaisen.S01E18.mkv" (455.96MB)
P:\Anime\Jujutsu Kaisen\Season 1\Jujutsu Kaisen.S01E18.mkv
using tvdb

search parameters
 - container = .mkv
 - group = None
 - language = None
 - language_sub = None
 - quality = None
 - synopsis = None
 - media = episode
 - series = Jujutsu Kaisen
 - season = 1
 - episode = 18
 - date = None
 - title = None
 - id_tvdb = 377543
 - id_tvmaze = None
 - extension = .mkv

no matches found
skipping (--no-guess)

... Repeat for next 6 episodes ...
AnalogMan151 commented 3 years ago

Since posting this I have run into a few more series that are affected and have found the cause. If an episode lacks an episode description (in the example show in the OP, Jujutsu Kaisen, episodes 18-24 have no summaries) then the matching will fail.

AnalogMan151 commented 3 years ago

Here's the issue: https://github.com/jkwill87/mnamer/blob/feea26aee7e6329c9c7ca79d4d892ae8332f9b86/mnamer/providers.py#L279-L282 If a synopsis is blank you set it to None but then the replace functions after error on a None object. Changing it to this works fine: synopsis=(entry["overview"] or "")

WaywardWizard commented 3 years ago

Thanks @AnalogMan151

I have added this to the MR i have for fixing issue #144