plugin.video.twitch icon indicating copy to clipboard operation
plugin.video.twitch copied to clipboard

Error playing live streams

Open neo-neo1 opened this issue 6 years ago • 22 comments

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

neo-neo1 avatar Feb 20 '20 23:02 neo-neo1

+1 on this, seeing the exact error OP posted

d4nl avatar Feb 20 '20 23:02 d4nl

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.

kcs32787github avatar Feb 20 '20 23:02 kcs32787github

https://github.com/MrSprigster/Twitch-on-Kodi/releases/tag/2.4.9-dev

anxdpanic avatar Feb 20 '20 23:02 anxdpanic

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.

anxdpanic avatar Feb 20 '20 23:02 anxdpanic

Alpha working like a charm for me. Thanks for crazy fast fix!

kcs32787github avatar Feb 20 '20 23:02 kcs32787github

https://github.com/MrSprigster/Twitch-on-Kodi/releases/tag/2.4.9-dev

Confirmed working fix

neo-neo1 avatar Feb 20 '20 23:02 neo-neo1

Was preparing a similar PR, fix works.

Orphis avatar Feb 21 '20 00:02 Orphis

I have that too! Thank you for the quick fix :)

pitsi avatar Feb 21 '20 05:02 pitsi

I've updated the zips to alpha2, allowing more than the first 100 results.

anxdpanic avatar Feb 21 '20 15:02 anxdpanic

Was the update going to land in the addon repo soon for easier usage?

ghost avatar Feb 21 '20 17:02 ghost

If there are no new issues reported with alpha2 it will be hopefully this weekend.

anxdpanic avatar Feb 21 '20 18:02 anxdpanic

thanks for the quick response

Baerht avatar Feb 21 '20 22:02 Baerht

What's the difference between the two zips? One is named 'unofficial'

cmsimike avatar Feb 22 '20 17:02 cmsimike

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.

anxdpanic avatar Feb 22 '20 17:02 anxdpanic

Thanks!

cmsimike avatar Feb 22 '20 17:02 cmsimike

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)?

ghost avatar Feb 23 '20 23:02 ghost

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.

pitsi avatar Feb 24 '20 06:02 pitsi

The automatic thumbnail cache clearing interacts with Kodi's databases directly, which isn't allowed.

anxdpanic avatar Feb 24 '20 17:02 anxdpanic

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

anxdpanic avatar Feb 24 '20 18:02 anxdpanic

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.

pitsi avatar Feb 26 '20 12:02 pitsi