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

The call to retrieve stream thumbnail fails with 401 - Invalid OAuth token #6

Open
commandercool opened this issue Nov 15, 2021 · 1 comment

Comments

@commandercool
Copy link
Contributor

I believe that to be able to access twitch api you need to get a temporary token using client id and secret of your application, please see: https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#oauth-client-credentials-flow .

I've tried to do so using CLIENT_ID_API and hardcoded OAUTH_TOKEN, with no luck though (I receive invalid client secret error message).

If thumbnail retrieval block is commented out - the rest is working as expected.

@commandercool
Copy link
Contributor Author

Actually, it looks like no API call is necessary anymore. The following works for me:

final String THUMBNAIL_URL = "https://static-cdn.jtvnw.net/previews-ttv/live_user_%s-440x248.jpg";
thumbnailUrl: String.format(THUMBNAIL_URL, channelName.toLowerCase())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant