Can't play stream. ERROR: EXCEPTION Thrown (PythonToCppException)
Context
Please provide any relevant information about your setup
- Add-on Version: 2.5.4
- Kodi Version:18.7
- Kodi GUI Language:English
- Operating System:Retropie
- Operating System Language:English
Current Behavior
I can't play the live stream, I get error all the time. Standard setup, just installed the addon, entered the key and tried to play one of the live stream in my favorites.
Log
https://paste.kodi.tv/exodebipaf.kodi
I'm with the same problem, I've redone a new configuration, but it's still the same problem, what was the solution?
Hi, I have the same problem
fresh instal of kodi and twitch adon + add oauth login for twitch
I can't play any live stream
Add-on Version: 2.5.11+matrix.1 Kodi Version:19.1 Kodi GUI Language:French Operating System:Windows 10 home Operating System Language:French
ERROR
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'KeyError'>
Error Contents: 0
Traceback (most recent call last):
File "C:\Users{userName}\AppData\Roaming\Kodi\addons\plugin.video.twitch\resources\lib\addon_runner.py", line 15, in
router.run(sys.argv) File "C:\Users{userName}\AppData\Roaming\Kodi\addons\plugin.video.twitch\resources\lib\twitch_addon\router.py", line 297, in run dispatcher.dispatch(mode, queries) File "C:\Users{userName}\AppData\Roaming\Kodi\addons\plugin.video.twitch\resources\lib\twitch_addon\addon\common\url_dispatcher.py", line 94, in dispatch self.func_registry[mode](*args, **kwargs) File "C:\Users{userName}\AppData\Roaming\Kodi\addons\plugin.video.twitch\resources\lib\twitch_addon\addon\error_handling.py", line 32, in wrapper result = func(*args, **kwargs) File "C:\Users{userName}\AppData\Roaming\Kodi\addons\plugin.video.twitch\resources\lib\twitch_addon\router.py", line 157, in _play play.route(twitch_api, seek_time, channel_id, video_id, slug, ask, use_player, quality, channel_name) File "C:\Users{userName}\AppData\Roaming\Kodi\addons\plugin.video.twitch\resources\lib\twitch_addon\routes\play.py", line 117, in route videos = api.get_live(name) File "C:\Users{userName}\AppData\Roaming\Kodi\addons\plugin.video.twitch\resources\lib\twitch_addon\addon\error_handling.py", line 89, in wrapper result = func(*args, **kwargs) File "C:\Users{userName}\AppData\Roaming\Kodi\addons\plugin.video.twitch\resources\lib\twitch_addon\addon\common\cache.py", line 104, in memoizer result = func(*args, **kwargs) File "C:\Users{userName}\AppData\Roaming\Kodi\addons\plugin.video.twitch\resources\lib\twitch_addon\addon\api.py", line 350, in get_live results = self.usher.live(name, headers=self.get_private_credential_headers()) File "C:\Users{userName}\AppData\Roaming\Kodi\addons\script.module.python.twitch\resources\lib\twitch\parser.py", line 52, in m3u8_wrapper results = f(*args, **kwargs) File "C:\Users{userName}\AppData\Roaming\Kodi\addons\script.module.python.twitch\resources\lib\twitch\api\usher.py", line 136, in live token = token[0][keys.DATA][keys.STREAM_PLAYBACK_ACCESS_TOKEN] KeyError: 0 -->End of Python script error report<--
I'm getting the same error, also on 2.5.11+matrix.1, but on ArchLinux.
If I can help by trying something or providing logs, let me know!
I switched Twitch to two-factor authentication yesterday. When using the Twitch addon right after that I was asked to renew my oauth token, which I did. Right before that everything worked fine, but since then I get the exact same error.
I undid 2FA, but the error stayed.
Did you guys enter an OAuth Token in the Private API Credentials section of the Login menu (at the very bottom)? I get this error message when I enter an incorrect token there (probably also when it expired)
Notably, it is NOT the same as the OAuth Token at the top of the same menu. See here https://github.com/anxdpanic/plugin.video.twitch/issues/461#issuecomment-552670340 how to obtain this second token from the Twitch webpage.
Did you guys enter an OAuth Token in the Private API Credentials section of the Login menu (at the very bottom)? I get this error message when I enter an incorrect token there (probably also when it expired)
Notably, it is NOT the same as the OAuth Token at the top of the same menu. See here #461 (comment) how to obtain this second token from the Twitch webpage.
Thanks for the reminder. Apparently, switching to 2FA caused my oauth-token in settings.xml ("Private API Credentials") to become invalid. I had to grab it from my twitch website cookie again, copied it into settings.xml and now everything works perfectly again as before. I'm sure if I had done that after enabling 2FA it would have fixed the issue as well.
Did you guys enter an OAuth Token in the Private API Credentials section of the Login menu (at the very bottom)? I get this error message when I enter an incorrect token there (probably also when it expired)
Notably, it is NOT the same as the OAuth Token at the top of the same menu. See here #461 (comment) how to obtain this second token from the Twitch webpage.
Thank you, that really was the problem in my case! The whole setup is really unintuitive, though :( The process of getting the first OAuth Token is complicated enough, but the one for the Private API Credentials section? Without your help I would have never known what to do...
FYI: For who is setting this up via the config file (.kodi/userdata/addon_data/plugin.video.twitch/settings.xml):
- The first OAuth Token goes into the
oauth_tokensetting (removedefault="true") - The OAuth Client ID from the Private API Credentials section (
kinme78...) goes into theprivate_oauth_clientidsetting - The OAuth Token from the Private API Credentials section (extracted from the website as explained here) goes into the
private_oauth_tokensetting
Again, thanks for your help!
I'll agree that documentation, UI and probably also error handling for this could be better (if someone has the time and is willing to do it is another story).
As for the process itself, I'm not sure it can be improved by a lot. This private OAuth token and the APIs it's used for are not part of the official Twitch API, so there's no straight forward way to obtain it. Maybe it would be possible to implement a full login feature, where you enter your username+password (+2FA) and it fetches the token for you. But I feel like this would be a significant amount of work and comes with its own set of problems (like would you actually want to give your password to the addon?)
Hi, I have exactely the same problem, i tried to change many time my token oauth but still same result :
2021-10-29 18:19:45.234 T:9009 ERROR
https://forum.kodi.tv/showthread.php?tid=134538&pid=2919187#pid2919187 just helped me.