Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to recieve access token #5

Closed
ppzz123 opened this issue Dec 15, 2019 · 17 comments
Closed

Unable to recieve access token #5

ppzz123 opened this issue Dec 15, 2019 · 17 comments
Labels
bug Something isn't working

Comments

@ppzz123
Copy link

ppzz123 commented Dec 15, 2019

Hi,

I used your fork as https://github.com/nikitakatchik/smarttv-twitch doesn't work anymore. Your fork works again, I can browse games and see channel thumbnails but as soon as I want to start watching a channel by pressing OK on my remote, it says "Unable to retrieve access token".

Any idea on how I can fix this? Thanks in advance.

@Fansh1ne
Copy link

Create your own API key and replace it. That's how I made it working.

@ppzz123
Copy link
Author

ppzz123 commented Dec 16, 2019

Create your own API key and replace it. That's how I made it working.

Oh ok. Do I get a key with this manual? https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/#oauth-client-credentials-flow

@Fansh1ne
Copy link

Honestly, i googled and found mine somehow, can't remember (app or chrome extension) and i'm no expert at this :)

@SpaceOgre
Copy link
Owner

@Fansh1ne are you talking about the Client-ID?

@SpaceOgre
Copy link
Owner

I have an Idea that might work some of the calls are missing xmlHttp.setRequestHeader('Accept', 'application/vnd.twitchtv.v5+json');

I can add it but I won't be able to test it myself, small kids and no time these days.

@SpaceOgre
Copy link
Owner

Could you please test the new version of SceneChannel.js here:
https://github.com/SpaceOgre/smarttv-twitch/blob/bugfix/client-id-accept/app/scenes/SceneChannel.js
You just have to replace the one in the Zip-file with it

@Fansh1ne
Copy link

@Fansh1ne are you talking about the Client-ID?

API key.

@SpaceOgre
Copy link
Owner

@Fansh1ne are you talking about the Client-ID?

API key.

Not sure what you mean, the APP does not use an API key. It uses a Client-ID (which is a kind of key I guess), Have you added a new header to the requests with this API key?

@Fansh1ne
Copy link

app/scenes/SceneChannel.js: xmlHttp.setRequestHeader('Client-ID', '#change_me'); in loadDataRequest function.
This specific one is used for video playback.

Someone wrote this on nikitakatchik/smarttv-twitch and that's what I did.
So far it's working, no issues.

@SpaceOgre
Copy link
Owner

Okay, hoppfully my fix above should work and you wont have to replace the Client-ID/API-key everytime. Feel free to test if you got the time.

@Fansh1ne
Copy link

I have just tested it. Without changing "app/scenes/SceneChannel.js: xmlHttp.setRequestHeader('Client-ID', '#change_me'); in loadDataRequest function" it's not working as intended. It shows channels but doesn't want to start them. When I changed this it's working normally.
So my guess (I'm not a developer) is that the key that is used is blocked by twitch and needs to be changed.

@SpaceOgre
Copy link
Owner

Okay thanks for testing :)
Will see if I can figure something out.

@Fansh1ne
Copy link

Thank you for your hard work! If you need help, I'm here.

@SpaceOgre
Copy link
Owner

Replaced the Client-ID with a new one and now it works (for now atleast).
Also fixed a bug with updateStreamInfo that used the v3 call that are not working anymore.

If you have the time later please download a new copy of master with all the fixes

@Fansh1ne
Copy link

Tested. It's working as it should. Great work, thank you so much !
Suggestions:

  1. Is it possible to add chat feature which could be turned on and off?
  2. There is a 20-30sec delay when watching stream compared to pc. Can something be done?

@SpaceOgre SpaceOgre added the bug Something isn't working label Dec 19, 2019
@SpaceOgre
Copy link
Owner

For the chat I created #8
Regarding the delay I think it might be hard to do anything, the just gets the playlist which contains a list of the qualities and a url to the stream. This url is then passas to the Samsung TV javascript for playback. When you say PC do you mean the official Twitch website/Windows app or something else?

Thanks for taking the time to test it 😊👍

@Fansh1ne
Copy link

For the chat I created #8
Regarding the delay I think it might be hard to do anything, the just gets the playlist which contains a list of the qualities and a url to the stream. This url is then passas to the Samsung TV javascript for playback. When you say PC do you mean the official Twitch website/Windows app or something else?

Thanks for taking the time to test it 😊👍

Yes, I meant using official Twitch website in Chrome or using android twitch app on mobile. Always a 20-30sec delay.
Thanks once again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants