Error Type: <class 'KeyError'>
Error Contents: 'data'
Traceback (most recent call last):
File "C:\Users\almpez\AppData\Roaming\Kodi\addons\plugin.video.svtplay\default.py", line 12, in <module>
svt_play.run(PLUGIN_PARAMS)
File "C:\Users\almpez\AppData\Roaming\Kodi\addons\plugin.video.svtplay\resources\lib\svtplay.py", line 74, in run
self.navigate(arg_mode, arg_id, arg_params)
File "C:\Users\almpez\AppData\Roaming\Kodi\addons\plugin.video.svtplay\resources\lib\svtplay.py", line 103, in navigate
self.start_video(id)
File "C:\Users\almpez\AppData\Roaming\Kodi\addons\plugin.video.svtplay\resources\lib\svtplay.py", line 223, in start_video
video_data = self.graphql.getVideoDataForLegacyId(legacy_id)
File "C:\Users\almpez\AppData\Roaming\Kodi\addons\plugin.video.svtplay\resources\lib\api\graphql.py", line 199, in getVideoDataForLegacyId
json_data = self.__get(operation_name, query_hash, variables=variables)
File "C:\Users\almpez\AppData\Roaming\Kodi\addons\plugin.video.svtplay\resources\lib\api\graphql.py", line 373, in __get
return json_data["data"]
KeyError: 'data'
Workaround
The video doesn't have the numeric legacy id in it's url. As a workaround, when collection item data in __get_all_programs(), I changed
item_id = raw_item["urls"]["svtplay"]
to
if "variants" in raw_item:
item_id = raw_item["variants"][0]["urls"]["svtplay"]
else:
item_id = raw_item["urls"]["svtplay"]
Not a nice solutions, but it work for me right now. Better would be to be able to handle video links without numeric video id in a similar way as for numeric legacy id links (getVideoDataForLegacyId())
Problem description
Unable to start some videos in Programs A-Ö
Steps to reproduce
System information
Kodi version: 19.4
Platform: Windows
Plugin version: 5.1.14+matrix.1
Log
Workaround
The video doesn't have the numeric legacy id in it's url. As a workaround, when collection item data in __get_all_programs(), I changed
item_id = raw_item["urls"]["svtplay"]
toNot a nice solutions, but it work for me right now. Better would be to be able to handle video links without numeric video id in a similar way as for numeric legacy id links (getVideoDataForLegacyId())