plugin.video.netflix: Opening a video crashes with KeyError: u'videos'

Bug report

Your Environment

  • Netflix add-on version: 1.2.0
  • Operating system version/name: CoreElec 9.2.2
  • Device model: Tanix TX92

Used Operating system:

  • Android
  • iOS
  • Linux
  • OSX
  • Raspberry-Pi
  • Windows

Describe the bug

Sometimes it crashed when trying to open some videos

Steps to reproduce the behavior

in most cases it crashed on this anime series
https://www.netflix.com/watch/81033447

Possible fix

resources/lib/kodi/infolabels.py:257

Original:

raw_data = api.get_video_raw_data(videoids_to_request)
for videoid in videoids_to_request:
    infos = get_info(videoid, raw_data['videos'][videoid.value], raw_data, profile_language_code)[0]

Fixed

raw_data = api.get_video_raw_data(videoids_to_request)
    if raw_data:
        for videoid in videoids_to_request:
            infos = get_info(videoid, raw_data['videos'][videoid.value], raw_data, profile_language_code)[0]

Debug log

ERROR: [plugin.video.netflix (2)] Traceback (most recent call last):
    File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 207, in run
    route([part for part in g.PATH.split('/') if part])
    File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 38, in lazy_login_wrapper
    return func(*args, **kwargs)
    File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/run_addon.py", line 62, in route
    play(videoid=pathitems[1:])
    File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/common/videoid.py", line 295, in wrapper
    return func(*args, **kwargs)
    File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/common/logging.py", line 143, in timing_wrapper
    return func(*args, **kwargs)
    File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/navigation/player.py", line 93, in play
    [videoid, videoid_next_episode] if videoid_next_episode else [videoid])
    File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/kodi/infolabels.py", line 259, in get_info_from_netflix
    infos = get_info(videoid, raw_data['videos'][videoid.value], raw_data, profile_language_code)[0]
KeyError: u'videos'

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (7 by maintainers)

Most upvoted comments