Open BarryCarlyon opened 4 years ago
The problem also exists with the follows endpoint
For example: https://api.twitch.tv/helix/users/follows?to_id=26610234
{
"from_id": "79645823",
"from_name": "Cochelosf",
"to_id": "26610234",
"to_name": "CohhCarnage",
"followed_at": "2019-12-06T19:44:14Z"
}
Both to_name
and from_name
contain the users display_name instead of the user login
Issue also exists on live_activated_channels
{
"channels": [
{
"id": "40118378",
"username": "Chronor007",
"game": "Magic: The Gathering",
"title": "🥴 Trying new Liliana deck from Twitch Prime!🥴 [GER/EN] !sounds !sr ",
"view_count": "9218"
}
]
}
Issues also exists on "Get Clips"
{
"data": [
{
"id": "EmpathicWildGuanacoKappaClaus",
"url": "https://clips.twitch.tv/EmpathicWildGuanacoKappaClaus",
"embed_url": "https://clips.twitch.tv/embed?clip=EmpathicWildGuanacoKappaClaus",
"broadcaster_id": "26610234",
"broadcaster_name": "CohhCarnage",
"creator_id": "17268377",
"creator_name": "KrunkSplein",
"video_id": "520874596",
"game_id": "494684",
"language": "en",
"title": "Loading Rock",
"view_count": 33,
"created_at": "2019-12-13T15:46:03Z",
"thumbnail_url": "https://clips-media-assets2.twitch.tv/AT-cm%7C583875183-preview-480x272.jpg"
}
],
"pagination": {}
}
HLX-1333
The new
https://dev.twitch.tv/docs/api/reference#get-channel-information
also has this issue, for example
{
broadcaster_id: '23161357',
broadcaster_name: 'LIRIK',
broadcaster_language: 'en',
game_id: '497440',
game_name: 'Hell Let Loose',
title: ':D '
}
https://dev.twitch.tv/docs/extensions/reference/#get-live-channels-with-extension-activated
Example use case:
https://twitch.extensions.barrycarlyon.co.uk/elitetrack/
To show streamers live with my extension and link to their channel, I have to do two requests, one to live_activated then a second to users to get the login for link/embed purposes
@BarryCarlyon so what is the solution for generating URLS via this API: https://dev.twitch.tv/docs/api/reference#get-users?
If I'm reading correctly, display_name is not a reliable parameter (korean characters, etc. possible), so I should leverage the login parameter instead?
That is to say if I got { ..., display_name: "Display Name", login: "loginname", ... }
, then I would generate the url https://twitch.tv/loginname
, correct?
Essentially my use case is trying to get the URL to the authenticated user's profile.
If I'm reading correctly, display_name is not a reliable parameter (korean characters, etc. possible), so I should leverage the login parameter instead?
Correct, the users API is the ONLY API that returns the actual login, where the login is used for URLs.
If you called the streams API, you get a list of Display Names then have to do a lookup against the users API to get the logins for construction URLs/links to channel. Two lookups where one should of suffice.
https://dev.twitch.tv/docs/api/reference/#get-stream-markers
Returns dISPlayNAME instead of user login for the creating user of the marker
Example use case: https://barrycarlyon.github.io/twitch_misc/examples/browse_following/
I have to do one call to get the streams of the people I follow. Then a second call to get the usernames of those people to generate a link to that stream.
EventSub has now contracted the virus for saying "name" and sending dIsPlAy_NaMe
instead
Eventsub fixed it on eventsub \o/
As per todays documentation and API update noted in the change log
https://dev.twitch.tv/docs/change-log
The following endpoints no longer suffer from GitHub issue 3.
GET helix/bits/leaderboard
GET helix/channel_points/custom_rewards
PATCH helix/channel_points/custom_rewards
POST helix/channel_points/custom_rewards
GET helix/channel_points/custom_rewards/redemptions
PATCH helix/channel_points/custom_rewards/redemptions
GET helix/extensions/transactions
GET helix/moderation/banned
GET helix/moderation/banned/events
GET helix/moderation/moderators
GET helix/moderation/moderators/events
GET helix/search/channels
GET helix/streams
GET helix/streams/markers
GET helix/videos
GET helix/users/follows
Most notably omitted at this time are the subscription related endpoints and extension live_activated_channels
But not longer for streams do we need to fetch users to get the username to link with! \o/
Channel editors has the virus!
https://dev.twitch.tv/docs/api/reference#get-channel-editors
And the new Get Extension Live Channels has it too which replaced extension live_activated_channels
https://dev.twitch.tv/docs/api/reference#get-extension-live-channels
Get Extension Live Channels and Get Channel Editors currently seem to be correct as per our documentation. broadcaster_name
is the display name, not the user's login. The Get Extension Live Channels endpoint simply does not return the user's login, just Display Name and User ID.
Behavior likely wont change as user_name
is consistent across all API endpoints. Ideally it would be called display_name
instead, but since the field is already in place it would be a breaking change to rename it.
Best course of action from here would be adding the field user_login
to these endpoints, but that would be a UserVoice suggestion rather than a bug.
Brief description
Streams API returns the
user_name
as the usersdisplay_name
instead.Meaning for people building a embed from an API lookup either parse the thumbnail URL for the username, or call the users API to get the correct login name for the embed.
This is particularly a problem for "Korean" Streamers
For example
https://api.twitch.tv/helix/streams?user_id=139470326
Which returns the user_name as
한동숙
which is not valid for building a embed or channel URLHow to reproduce
Call https://api.twitch.tv/helix/streams?user_login=cohhcarnage
Expected behavior
Return "cohhcarnage" as the user_name instead of "CohhCarnage"
And/or extend the endpoint to return both