haijeploeg / excludarr

Excludarr manages your libraries in Radarr/Sonarr. It keeps track of your library and checks if your movies and series are also available on a configured streaming provider. It can exclude the movies and series that are available on a configured streaming provider. But it can also re-add movies and series if they are not streaming anymore.
MIT License
197 stars 12 forks source link

Key Error 'Episodes' Raddar runs fine Sonarr fails #31

Closed ehwhattaugonnado closed 2 years ago

ehwhattaugonnado commented 2 years ago

Radarr ran fine but Sonarr fails with the following error. Have confirmed that URL and API key for Sonarr are correct.

:~/docker/excludarr$ docker run -it --rm --env-file excludarr.env haijeploeg/excludarr:latest sonarr exclude -a delete -d -e -y --progress
Working... ━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━  59% 0:00:31
Traceback (most recent call last):
  File "/usr/local/bin/excludarr", line 33, in <module>
    sys.exit(load_entry_point('excludarr==1.0.2', 'console_scripts', 'excludarr')())
  File "/usr/local/lib/python3.10/site-packages/excludarr-1.0.2-py3.10.egg/excludarr/main.py", line 68, in cli
  File "/usr/local/lib/python3.10/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/typer/main.py", line 500, in wrapper
    return callback(**use_params)  # type: ignore
  File "/usr/local/lib/python3.10/site-packages/excludarr-1.0.2-py3.10.egg/excludarr/commands/sonarr.py", line 69, in exclude
  File "/usr/local/lib/python3.10/site-packages/excludarr-1.0.2-py3.10.egg/excludarr/core/sonarr_actions.py", line 197, in get_series_to_exclude
KeyError: 'episodes'
haijeploeg commented 2 years ago

Hmm that is strange... It seems that there is a strange bug in the sonarr_actions.py file. I need more information to reproduce this. Can you execute the following command: docker run -it --rm --env-file excludarr.env haijeploeg/excludarr:latest --debug sonarr exclude -a delete -d -e and paste the full debug output (from beginning to the error)? If it is too long you can use pastebin or github gist.

ehwhattaugonnado commented 2 years ago

log attached https://pastebin.com/Bpt6K2G0

stayupthetree commented 2 years ago

With key: https://pastebin.com/dGF6eks2 Without key: https://pastebin.com/1SK3Sxrx

Had to remove about 2000 lines from the Without paste because it was too large for Pastebin

stayupthetree commented 2 years ago

Interesting bit about Lupin, and IDK if this is helpful or not, but Netflix and JustWatch has it as "2 Parts" of 5 epsiodes each, but TMDB, Sonarr, and show it as 1 Season of 10 episodes

haijeploeg commented 2 years ago

I have found the issue and it is related to #30 . I am releasing a fix next week. The issue is that JustWatch sometimes lists more seasons than there are released in fact. Those seasons are probably future seasons, because not all the information is available about those seasons yet, we cannot process them in Excludarr, because Excludarr needs that information.

Interesting bit about Lupin, and IDK if this is helpful or not, but Netflix and JustWatch has it as "2 Parts" of 5 epsiodes each, but TMDB, Sonarr, and show it as 1 Season of 10 episodes

Haha nice catch! Unfortunately I cannot do anything about this. Excludarr will remove half of Season 1 in Sonarr. Because of the inconstancy in the API this is probably one rare exception which I cannot catch automatically. Since it is a Netflix original show you can manually delete it and add an import exclusion for it.

haijeploeg commented 2 years ago

Fixed in #35. Functionality should be fixed in version 1.0.3 (going to release this today or tomorrow)

haijeploeg commented 2 years ago

Version v1.0.3 is out!