stefansundin / rssbox

:newspaper: I consume the world via RSS feeds, and this is my attempt to keep it that way.
https://github.com/stefansundin/rssbox/discussions/64
GNU Affero General Public License v3.0
762 stars 73 forks source link

Twitch integration broken? #42

Open onli opened 4 years ago

onli commented 4 years ago

To me it seems like the Twitch integration is not working anymore. The Readme points to https://www.twitch.tv/settings/connections, but it seems the application management has moved to https://dev.twitch.tv/console/apps/. It's possible to create an app there and you also get a clientid, but if you set that clientid Twitch complains about the Oauth token:

 2020-06-25T15:38:46.102522+00:00 app[web.1]: 2020-06-25 15:38:46 - TwitchError - 401: {"error":"Unauthorized","status":401,"message":"OAuth token is missing"}:

That's when trying to get a feed for a user.

Did Twitch break the rss box API access, or am I misunderstanding what data needs to be provided?

stefansundin commented 4 years ago

Hmm. It appears that it is because of this: https://discuss.dev.twitch.tv/t/requiring-oauth-for-helix-twitch-api-endpoints/23916

For a workaround, use the client-id that this Twitch extension is using (it is in the URL): https://dashboard.twitch.tv/extensions/0qr7fa6llzn4txgnfgb8ipeksd5v24

I will update the code later to make this work with your own Client-ID at some point. Thanks for letting me know!

stefansundin commented 4 years ago

Oh, looks like they broke embeds too.. is this the warning signs that Twitch is starting to lock down their platform ala Instagram? Boo!

twitch-embed

In the console:

Twitch embed error message: [NoParent] parent query string value was not specified Docs: https://dev.twitch.tv/docs/embed/video-and-clips/

So I need to start telling them the website that is embedding with &parent=example.com? What total and utter garbage.

onli commented 4 years ago

That parent parameter is one of the most stupid things I ever saw on the internet. Completely defeats the purpose of embeds - and that in a world where youtube embeds do not need this.

I never saw the feed rssbox would produce for twitch. It would include those embeds?

stefansundin commented 4 years ago

Yes, so if your RSS reader supports iframes, you can watch it right there. You also get the embeds if you subscribe to other services, e.g. Twitter and the person tweets a link to a Twitch video or channel.

Apparently the claim is that they need it for CSP headers.. but I don't see why they can't just allow whatever Origin that the web browser sends.. Hmm.. I'll see what I think after I have time to look at it more.

stefansundin commented 3 years ago

I have worked around the embedding issue now.

stefansundin commented 3 years ago

For those hosting themselves, you now have to use:

TWITCHTOKEN_CLIENT_ID=b31o4btkqth5bzbvr9ub2ovr79umhh
amblerkr commented 2 years ago

I created a new app and pasted the client ID, but it doesn't work. The client ID you told me does not work either. Is it completely dead?

stefansundin commented 2 years ago

The values that I currently use are:

TWITCH_CLIENT_ID=0qr7fa6llzn4txgnfgb8ipeksd5v24
TWITCHTOKEN_CLIENT_ID=b31o4btkqth5bzbvr9ub2ovr79umhh

You can get the TWITCH_CLIENT_ID value, and other client ids used by twitch.tv itself, by running:

URL=$(curl -sL https://www.twitch.tv/ | grep -oE 'https://static.twitchcdn.net/assets/core-[a-z0-9]+.js')
curl -sL "$URL" | grep -oE '"[a-z0-9]{30}"'

I can't remember why I am not using my own client id anymore..