Closed efirshik closed 4 years ago
I started getting an identical problem just now also. Streams appear, but error out on attempting to play.
2019-11-08 14:35:28.275 T:4092644784 ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.twitch/?channel_id=23945610&mode=play]
2019-11-08 14:35:30.083 T:3534066560 WARNING: script.module.python.twitch: API version |V5| is deprecated, update to |Helix| by |TBD|
2019-11-08 14:35:30.561 T:3534066560 NOTICE: Twitch: Calling |_play| for mode |play| with pos args |[]| and kwargs |{'channel_id': '136765278'}|
2019-11-08 14:35:31.072 T:3534066560 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'dict' object has no attribute 'decode'
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 157, in _play
play.route(twitch_api, seek_time, channel_id, video_id, slug, ask, use_player, quality, channel_name)
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/routes/play.py", line 116, in route
videos = api.get_live(name)
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/addon/error_handling.py", line 80, in wrapper
result = func(*args, **kwargs)
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/addon/common/cache.py", line 104, in memoizer
result = func(*args, **kwargs)
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/addon/api.py", line 325, in get_live
results = self.usher.live(name)
File "/storage/.kodi/addons/script.module.python.twitch/resources/lib/twitch/parser.py", line 51, in m3u8_wrapper
results = results.decode('utf-8')
I'm having the same issue
2019-11-08 22:04:16.854 T:1480585952 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.AttributeError'> Error Contents: 'dict' object has no attribute 'decode' Traceback (most recent call last): File "/home/pi/.kodi/addons/plugin.video.twitch/resources/lib/addon_runner.py", line 15, in
router.run(sys.argv) File "/home/pi/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/router.py", line 297, in run dispatcher.dispatch(mode, queries) File "/home/pi/.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 "/home/pi/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/addon/error_handling.py", line 29, in wrapper result = func(*args, *kwargs) File "/home/pi/.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 "/home/pi/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/routes/play.py", line 116, in route videos = api.get_live(name) File "/home/pi/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/addon/error_handling.py", line 80, in wrapper result = func(args, kwargs) File "/home/pi/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/addon/common/cache.py", line 104, in memoizer result = func(*args, **kwargs) File "/home/pi/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/addon/api.py", line 325, in get_live results = self.usher.live(name) File "/home/pi/.kodi/addons/script.module.python.twitch/resources/lib/twitch/parser.py", line 51, in m3u8_wrapper results = results.decode('utf-8') AttributeError: 'dict' object has no attribute 'decode' -->End of Python script error report<-- 2019-11-08 22:04:17.116 T:1902371680 ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.twitch/?channel_id=15564828&mode=play]
Can confirm, observing same issue as above. Although I was trying to watch a VOD rather than livestream.
2019-11-08 21:36:07.030 T:1344902000 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'dict' object has no attribute 'decode'
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 311, 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 171, in _play
play.route(twitch_api, seek_time, channel_id, video_id, slug, ask, use_player, quality, channel_name)
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/routes/play.py", line 87, in route
_videos = api.get_vod(video_id)
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/addon/error_handling.py", line 80, in wrapper
result = func(*args, **kwargs)
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/addon/common/cache.py", line 104, in memoizer
result = func(*args, **kwargs)
File "/storage/.kodi/addons/plugin.video.twitch/resources/lib/twitch_addon/addon/api.py", line 326, in get_vod
results = self.usher.video(video_id)
File "/storage/.kodi/addons/script.module.python.twitch/resources/lib/twitch/parser.py", line 51, in m3u8_wrapper
results = results.decode('utf-8')
AttributeError: 'dict' object has no attribute 'decode'
-->End of Python script error report<--
Streamlink is having the same issue: https://github.com/streamlink/streamlink/issues/2680
Enabling debug logging gives some insight:
2019-11-08 22:32:04.256 T:140712499615488 DEBUG: Twitch: Calling cached method: |twitch_addon.addon.api.Twitch.get_
live|
2019-11-08 22:32:04.258 T:140712499615488 DEBUG: script.module.python.twitch: GET QUERY: url: |https://api.twitch.tv/api/channels/heromarine/access_token|, params: |{'need_https': 'true', 'platform': 'web', 'player_backend': 'mediaplayer'}|, data: |{}|, headers: |{'Client-ID': '*****', 'Authorization': 'OAuth ***********'}|, target_func: |channel_token|
2019-11-08 22:32:04.259 T:140712499615488 DEBUG: script.module.python.twitch: Downloading: |https://api.twitch.tv/api/channels/heromarine/access_token?need_https=true&platform=web&player_backend=mediaplayer|
2019-11-08 22:32:04.566 T:140712499615488 DEBUG: script.module.python.twitch: url: |https://api.twitch.tv/api/channels/heromarine/access_token| parameters: |{'need_https': 'true', 'platform': 'web', 'player_backend': 'mediaplayer'}|
{
"error": "Gone",
"message": "this API has been removed.",
"status": 410
}
2019-11-08 22:32:04.571 T:140712499615488 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
So it seems like the used API call is not available like this anymore.
Anyone know of a workaround?
Anyone know of a workaround?
I managed to get it working by changing the OAuth client ID
under the Developer menu to the Twitch website Client ID (kimne78kx3ncx6brgo4mv6wki5h1ko
) and using OAuth Token
extracted from web browser cookie (auth-token
). This sort of works as streams are playing again but I don't get the user categories (e.g. Followed channels and such).
Lets hope this isn't Twitch shutting down 3rd party applications :(
I had to remove my existing auth-token, then change the client ID to the twitch website one, then pull the new auth-token from the website manually (not use the built in request-auth-token function). If I did not remove my existing auth token the change in the client ID would be rejected (probably because the token was associated with the v3 api?)
To me it looks like client IDs and tokens associated with the v3 api are what are not working.
Neither of the above worked for me, but I might have used the wrong token. That being said even if I have no auth info at all trying to play a stream is erroring for me.
Seeing the same error here. Hopefully this isn't the end of the v3 api.
Its working again.
Working again here. With the client-id empty. Just using the 0authtoken. Generated by twitchaddon.page/***** link.
EDIT: And broken again?
I was getting the same API fail and/or timeout issues when Twitch tied itself in knots dealing with the huge extra load from the Fortnite new season event a few weeks ago. Is there a big load-generating event happening on the service currently ?
"following live channels" work again, without manipulation with token :)
Problem back today again. Seems that there's not much to be done other than hope Twitch doesn't break the undocumented API endpoint permanently. From the discussion over at streamlink it seems there's no real alternative.
Question is would it be possible to use the Twitch client ID with your web user auth-token and still get Followed channels and similar in Twitch-on-Kodi?
yes problem back again today :(
Problem back today again. Seems that there's not much to be done other than hope Twitch doesn't break the undocumented API endpoint permanently. From the discussion over at streamlink it seems there's no real alternative.
Question is would it be possible to use the Twitch client ID with your web user auth-token and still get Followed channels and similar in Twitch-on-Kodi?
Confirmed, same problem is back. I hope this is fixable...
I just streamed something using the 'fix' mentioned previously (their client-id, my auth token).
I just streamed something using the 'fix' mentioned previously (their client-id, my auth token).
Indeed, I can confirm this is works though is not the ideal solution. Credit goes to @fragande for detailed instructions
Yeah, it's a workaround for now I guess. Today when I changed back to the Twitch client ID + web auth token I actually didn't lose Followed channels, no idea why. According to the cookie data the web auth token should be good for 6 months.
If it's possible to keep Followed channels and such it could be a "permanent" solution (until Twitch shuts that down too ...), albeit a very dirty one that probably breaks ToS. Third party apps are supposed to use their own client ID's.
I just streamed something using the 'fix' mentioned previously (their client-id, my auth token).
Indeed, I can confirm this is works though is not the ideal solution. Credit goes to @fragande for detailed instructions
Did either of you get to keep Followed channels when doing this?
Yeah, it's a workaround for now I guess. Today when I changed back to the Twitch client ID + web auth token I actually didn't lose Followed channels, no idea why. According to the cookie data the web auth token should be good for 6 months.
If it's possible to keep Followed channels and such it could be a "permanent" solution (until Twitch shuts that down too ...), albeit a very dirty one that probably breaks ToS. Third party apps are supposed to use their own client ID's.
I just streamed something using the 'fix' mentioned previously (their client-id, my auth token).
Indeed, I can confirm this is works though is not the ideal solution. Credit goes to @fragande for detailed instructions
Did either of you get to keep Followed channels when doing this?
Surprisingly enough yes, the followed channels do work as expected
this issue seems to be wide spread across several 3 party viewing 'apps' . Streamview Is also experiencing this as well
Surprisingly enough yes, the followed channels do work as expected
I guess I did something differently the first time then. In theory I don't think there should be a difference as it's the same data Twitch-on-Kodi is authorized to access when creating the OAuth, but didn't work for me first time around.
this issue seems to be wide spread across several 3 party viewing 'apps' . Streamview Is also experiencing this as well
Yes, it's affecting every 3rd party app using this API endpoint. Seems Twitch are periodically blocking every client ID but their own for unknown reasons. It seems Twitch aren't happy about this endpoint being used in the first place as it's undocumented and unsupported but they haven't cracked down on the usage of it until now AFAIK.
I noticed a few versions of the Twitch API in the developer section of their site. I don't know much about this, or other addons, but how difficult would it be to use a newer more supported API version? I get there would be work involved but would it be worth it for hopefully some future proofing?
Can anyone explain the fix workaround? When i use twitch id oauthtoken (kimne78kx3ncx6brgo4mv6wki5h1ko)and the web generated auth token ,its still not working?
As mentioned, this is due to an undocumented API endpoint and is not included on their developer site.
We are currently use v5 at the moment for all other functions, which currently has no eol date. The helix API is ready in the module for when the time comes, it comes with additional limitations which is why we haven't migrated to helix yet.
Currently the only way to temporarily workaround this is to use the client id and oauth token from the website.
@xenius Just double checked here and it is working here. I'd double check you didn't get an extra character or something in the oauth token, and it shouldn't be required but you could also run Settings - Maintenance - Reset function cache
you want to use the oauth token you see in the same place as you found the client id, not the one you generated from the add-on (back that one up first).
Where can i find the exact 2 things i need to get this working again?
Where can i find the exact 2 things i need to get this working again?
Read this post, instructions have been posted.
Anyone know of a workaround?
I managed to get it working by changing the
OAuth client ID
under the Developer menu to the Twitch website Client ID (kimne78kx3ncx6brgo4mv6wki5h1ko
) and usingOAuth Token
extracted from web browser cookie (auth-token
). This sort of works as streams are playing again but I don't get the user categories (e.g. Followed channels and such).Lets hope this isn't Twitch shutting down 3rd party applications :(
If this is the post u mean. I still dont get it though ... How do i extract that from my browser cookie?
Where can i find the exact 2 things i need to get this working again?
You set the Twitch client ID (kimne78kx3ncx6brgo4mv6wki5h1ko) under Developer > OAuth Client ID
in the GUI. For the Login > OAuth Token
you want to extract it from the web page cookie (it's not the OAuth generated by the add-on you want). In Firefox go to twitch.tv (be logged in), right click anywhere and click Inspect element
, go to the Storage
tab. There should be a post called auth-token
. Copy that value and enter it in Kodi Login > OAuth Token
.
To avoid having to type everything manually you can also edit the settings.xml
file in .kodi/userdata/addon_data/plugin.video.twitch
:
<setting id="oauth_clientid">kimne78kx3ncx6brgo4mv6wki5h1ko</setting>
<setting id="oauth_token">paste_your_web_auth-token_here</setting>
Thank you... Working for me now. And i still have ly followed channels.
I can not find the Oauth_ClientID, what the browser you use? Thanks!
I can not find the Oauth_ClientID, what the browser you use? Thanks!
The client ID you want to use is kimne78kx3ncx6brgo4mv6wki5h1ko
, it's Twitch's own client ID. This value is static and same for everyone. Just use it in combination with your personal auth-token
from the web cookie (see my post above for Firefox instructions, for other browsers I don't know but it shouldn't be hard to find).
Thank you so much. It's working now
Thank you for all the info and the workaround. I do not have a twitch account, so I can not get anauth-token
for myself. Can I use only the clientid
provided above or will I run into problems?
I just entered it on my libreelec installation and I will check tonight if it works.
2019-11-12 13:06:54.736 T:16140 WARNING: script.module.python.twitch: API version |V5| is deprecated, update to |Helix| by |TBD| 2019-11-12 13:06:54.955 T:16140 NOTICE: Twitch: Calling |_list_followed| for mode |followed| with pos args |['channels']| and kwargs |{}| 2019-11-12 13:06:57.486 T:16140 NOTICE: Twitch: Calling |_list_channel_video_categories| for mode |channel_videos| with pos args |[]| and kwargs |{'channel_id': '23798553', 'display_name': 'MJRAMON', 'channel_name': 'mjramon'}| 2019-11-12 13:06:58.243 T:16140 NOTICE: Twitch: Calling |_list_channel_videos| for mode |channel_video_list| with pos args |['archive']| and kwargs |{'channel_id': '23798553', 'game': None}| 2019-11-12 13:07:00.409 T:16140 NOTICE: Twitch: Calling |_play| for mode |play| with pos args |[]| and kwargs |{'video_id': 'v506992318'}| 2019-11-12 13:07:02.750 T:16140 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
How to solve this error?
Read this thread, the only workaround as for now is to replace client ID and use web auth token. See https://github.com/MrSprigster/Twitch-on-Kodi/issues/461#issuecomment-552670340.
looks like they have unblocked things ,for now , 11:00 PST
Locked again
This is a quote. Original article is found at https://discuss.dev.twitch.tv/t/twitch-api-v3-and-v5-deprecation-updates/19144
Twitch API v3 and v5 Deprecation Updates Announcements jbulava Twitch Staff 1 Dec '18
Update (2019/07/25): Please see our latest information regarding the shutdown timeline for v3 here 241.
Greetings from Twitch,
We have important updates to share regarding deprecation of v3 and v5 of the Twitch API.
As previously communicated 54 in February 2017 and documented in the v5 API guide 107, Twitch planned to remove third-party support for the v3 API on December 31, 2018. However, we are delaying this process by a few weeks to provide developers more time to prepare for the upcoming changes. Starting in late January 2019, Twitch will begin a controlled shutdown of v3 over several weeks and withdraw v3 from public third-party access in early 2019. More details on the shutdown process and exact timelines will be made available in mid-January 2019. We will communicate these changes prior to starting shutdown and withdrawal activities through our developer channels like the Developer Forums, so please stay tuned.
Also, we previously documented that API calls without a specific API version in the headers would be directed to v5 endpoints after December 31, 2018. This change is also on hold. We will confirm an exact date for this transition in mid-January.
Finally, if your existing Twitch integration uses v3 of the Twitch API, you should immediately migrate to the new Twitch API. Documentation for the new Twitch API is here 132. If you have questions about moving to the new Twitch API, visit the API section 63 on our Twitch Developer Forums to learn more and ask questions.
As an important reminder, v5 of the Twitch API remains on a deprecation path. Twitch will announce an end-of-support date and shutdown plan for v5 in 2019.
We are working to make sure the upcoming changes will be as well communicated and documented as possible. As members of the Twitch community, we understand that you count on the reliability and stability of Twitch APIs. It is our goal, through these changes, to meet these requirements so that you can build more amazing experiences on Twitch. Thank you for your continued support and patience.
This is also a quote. Source is found at https://discuss.dev.twitch.tv/t/twitch-api-v3-shutdown-timeline/21931
Twitch API v3 Shutdown Timeline Announcements jbulava Twitch Staff Jul 25
On November 15, 2016, Twitch announced that the v3 API had been deprecated 43 with the release of v5. Today, we’re moving forward with a controlled shutdown 43 of v3 and would like to share our plans.
Starting on August 12, 2019, we will begin implementing scheduled outage windows of v3 endpoints over several weeks ending with a complete shutdown of v3 endpoints on September 12, 2019. If you do not take action to migrate your application to v5 of the API, your application will experience outages during this time and will break on September 12. The expected scheduled outage windows are as follows:
August 12 – 15 minute shutdown starting at 11:00am Pacific 9 August 15 – 1 hour shutdown starting at 11:00am Pacific 4 August 21 – 6 hour shutdown starting at 11:00am Pacific 13 August 22 – 24 hour shutdown starting at 11:00am Pacific 29 September 5 – 24 hour shutdown starting at 11:00am Pacific 16 September 12 – Permanent shutdown starting at 11:00am Pacific 16
We have prepared a migration guide 242 to assist you with updates to v5. We have also created a dedicated category on the Twitch Developer forums for migration questions 46. And as always, you can talk directly with other members of the community on the TwitchDev Discord server 18.
Thank you for being a valued member of the Twitch Developer community. This change is part of our continued effort to improve developer products which enable creators like yourself to deliver the interactive experiences that make Twitch what it is today.
@RevAngel7 From this issue #461 (comment) #461 (comment)
Hello anxdpanic, I got the error message "wrong oauth token" twice after I changed the oauth token, but it worked then. Thank you for your help!
This specific issue has nothing to do with the v3/v5 API. It uses a "private" API endpoint that isn't documented, and Twitch haven't communicated anything about it.
The Streamlink thread, and the progress/updates that team are making, should be pretty much in line with what's required to make the kodi plugin work.
Maybe a stupid question, but what's the oauth token even do on this specific API call?
I set the client ID to Twitch's and then straight up removed the oauth authorization header from the call in the twitch api module.
Everything as far as I can tell works fine. Still have the addon configured with the same oauth token I generated ages ago. My followed channels are still there, I can follow/unfollow, live notifications work, chat works, vods work...
today https://github.com/MrSprigster/Twitch-on-Kodi/issues/461#issuecomment-552670340 trick not work.
2019-11-17 13:06:01.541 T:3598697328 ERROR: ResourceUnavailableException: script.module.python.twitch: GET Query to https://api.twitch.tv/kraken/, params {}, data {}, headers {'Client-ID': u'kimne78kx3ncx6brgo4mv6wki5h1ko', 'Authorization': 'OAuth ***********', 'ACCEPT': 'application/vnd.twitchtv.v5+json', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20100101 Firefox/6.0'}
I managed it to get it working again, by changing the OAuth client ID under the Developer menu to the Twitch website Client ID (kimne78kx3ncx6brgo4mv6wki5h1ko). I DONT enter any OAuth Token.
Confirming @QueenGit: Leaving the oauth_token setting empty still gets me a working Twitch addon.
What I had to learn the hard way: kodi (or the Twitch addon?) doesn't like XML comments and crashes :(