laurencee / Livestream.Monitor

A windows GUI for livestreamer/streamlink
GNU General Public License v2.0
60 stars 8 forks source link

Update twitch api calls to V5 #25

Closed laurencee closed 6 years ago

laurencee commented 7 years ago

TwitchTv V3 API is being deprecated as of Feb 14 2017 and will be removed entirely in 2018. https://dev.twitch.tv/docs/

laurencee commented 7 years ago

Started playing around with this today, gonna take a bit more work than I originally thought due to the conversion of all the existing usernames into userids.

I'll probably need to use a caching system similar to youtube names to ids. https://github.com/laurencee/Livestream.Monitor/blob/master/Livestream.Monitor/Model/ApiClients/YoutubeApiClient.cs#L116

/ rant / It feels like whoever designed the v5 api doesn't have much experience with api design, they're leaking internal details through their api which as a consumer I shouldn't have to be concerned about. On a somewhat similar note, I'm curious as to why they moved from usernames to userids in their api. It doesn't make much sense to me given usernames are unique on their site and a userid is more of an internal detail.

TaoziDB commented 7 years ago

They moved from usernames to userids so that user can change name freely.

laurencee commented 7 years ago

That's generally what a display name is for. It just depends how they implemented their username field in the first place I guess.

If they are going to allow duplicates for usernames then they have to use a userid instead, but the username used to be unique as far as I know.

laurencee commented 7 years ago

I've decided when I get around to this to store an additional displayname field in livestreams.json.

laurencee commented 6 years ago

https://blog.twitch.tv/the-new-twitch-api-be3fb2b078e6 Looks like this wont be happening as there's a newer API coming out that sounds much better suited for the sorts of calls I want to do.

The current API the app uses should remain fine until the end of next year according to this blog.

I'm more incentivised to use this newer API as it should have bulk calls for stuff I currently have to do individual calls for.