Error playing live streams
Watching Twitch for hours today, when it suddenly broke. Unable to view my followed live channels. Only VODs work, nothing live.
People are reporting an identical error on Kodi forums
2020-02-20 17:45:59.845 T:3376563072 WARNING: script.module.python.twitch: API version |V5| is deprecated, update to |Helix| by |TBD|
2020-02-20 17:46:00.326 T:3376563072 NOTICE: Twitch: Calling |_list_followed| for mode |followed| with pos args |['live']| and kwargs |{}|
2020-02-20 17:46:00.360 T:3376563072 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.KeyError'>
Error Contents: '_total'
Traceback (most recent call last):
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/addon_runner.py", line 15, in <module>
router.run(sys.argv)
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/router.py", line 297, in run
dispatcher.dispatch(mode, queries)
File "/storage/.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 "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/addon/error_handling.py", line 29, in wrapper
result = func(*args, **kwargs)
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/router.py", line 101, in _list_followed
followed.route(twitch_api, content, offset, cursor)
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/routes/followed.py", line 37, in route
if (streams[Keys.TOTAL] > 0) and (Keys.STREAMS in streams):
KeyError: '_total'
-->End of Python script error report<--
2020-02-20 17:46:00.562 T:3384955776 ERROR: GetDirectory - Error getting plugin://plugin.video.twitch/?content=live&mode=followed
2020-02-20 17:46:00.567 T:4093976592 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.twitch/?content=live&mode=followed) failed
+1 on this, seeing the exact error OP posted
The issue is with the v5 API dropping the "_total" count field as discussed here. https://discuss.dev.twitch.tv/t/upcoming-changes-to-the-streams-v5-endpoints/23926 I do not know how to fix that however.
https://github.com/MrSprigster/Twitch-on-Kodi/releases/tag/2.4.9-dev
There are zips in the posted link, this will likely only work for the first 100 results. I am sick so I just got it working for the moment.
Alpha working like a charm for me. Thanks for crazy fast fix!
https://github.com/MrSprigster/Twitch-on-Kodi/releases/tag/2.4.9-dev
Confirmed working fix
Was preparing a similar PR, fix works.
I have that too! Thank you for the quick fix :)
I've updated the zips to alpha2, allowing more than the first 100 results.
Was the update going to land in the addon repo soon for easier usage?
If there are no new issues reported with alpha2 it will be hopefully this weekend.
thanks for the quick response
What's the difference between the two zips? One is named 'unofficial'
This is the diff: https://github.com/MrSprigster/Twitch-on-Kodi/commit/090fc415df200f2804c9e5cbc1e45d7ba8d851bf
The add-on used to be able to actually remove outdated thumbnails from the cache and database when refreshing live stream thumbnails. Since it is not allowed on the official repository it is still maintained separately for anyone that missed that feature.
Thanks!
Tested the zip linked here and live streams seem to work for me. Will it auto update to the official release when you upload it to the official repo?
Why is auto cache cleaning not allowed (from the inquiry about the unofficial zip)?
Yes, it will update to the final version of 2.4.9 once it hits the main repo. When it comes to versioning, kodi is able to understand that 2.4.9.alpha2 < 2.4.9 in the same manner that 1 < 2, so it will make the update by itself.
As for the unofficial zip, a lot of things are not allowed for the "official" addons in order to get a place in the main kodi repo. Restrictions on what an addon can and can (or should) not do, made by the kodi devs themselves. Youtube also has an unofficial version that, afaik, includes view overrides. Quite a harmless option if you ask me, but still something that is restricted.
The automatic thumbnail cache clearing interacts with Kodi's databases directly, which isn't allowed.
Submitted for review, also available https://github.com/MrSprigster/Twitch-on-Kodi/releases/tag/2.4.9
If you have alpha2, you gain nothing from the version bump and can wait for automatic update
Since 2.4.9 is now on the repo and twitch works like it used to, I think this issue can be closed, if everyone has got the update.