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

Kraken API: streams endpoint - "language" query string parameter is ignored #66

Closed
oliverfindl opened this issue Feb 22, 2020 · 9 comments
Labels
product: v5 API endpoints in the "v5" namespace ticketed Has been given an internal tracking ticket

Comments

@oliverfindl
Copy link

Brief description:
After recent (2020-02-21) changes to /streams#get-live-streams API endpoint, language query string parameter is ignored and API returns unfiltered results.


How to reproduce:

$ curl -H 'Accept: application/vnd.twitchtv.v5+json' -H 'Client-ID: CLIENT_ID' -X GET 'https://api.twitch.tv/kraken/streams/?language=ru&limit=1'

Expected behavior:
Return filtered result(s) by language.


Screenshots:
N/A


Additional context or questions:

  • originally submitted in documentation issue #64
  • same issue at Twitch forums (currently without any answer from Twitch staff)
@oliverfindl oliverfindl added the product: v5 API endpoints in the "v5" namespace label Feb 22, 2020
@jbulava
Copy link
Member

jbulava commented Feb 23, 2020

Also refer to this forum post.

It mentioned an issue with boradcaster_language as well, although undocumented/unsupported.

@fgl27
Copy link

fgl27 commented Feb 29, 2020

Languages works for clips but there is issues that started with this issue...

Getting a lot of 500 error when using a cursor and a language from clip api "https://api.twitch.tv/kraken/clips/top"

curl -s \
  -H "Accept: application/vnd.twitchtv.v5+json" \
  -H "Client-ID: the-id" \
  "https://api.twitch.tv/kraken/clips/top?limit=100&period=day&language=en" \
  | jq -r "._cursor"

MTAw

curl -s \
  -H "Accept: application/vnd.twitchtv.v5+json" \
  -H "Client-ID: the-id" \
  "https://api.twitch.tv/kraken/clips/top?limit=100&period=day&cursor=MTAw&language=en" \
  | jq -r "._cursor"

MjAw

curl -s \
  -H "Accept: application/vnd.twitchtv.v5+json" \
  -H "Client-ID: the-id" \
  "https://api.twitch.tv/kraken/clips/top?limit=100&period=day&cursor=MjAw&language=en" \
  | jq -r "._cursor"

null

curl -s \
  -H "Accept: application/vnd.twitchtv.v5+json" \
  -H "Client-ID: the-id" \
  "https://api.twitch.tv/kraken/clips/top?limit=100&period=day&cursor=MjAw&language=en" \
  | jq
{
  "error": "Internal Server Error",
  "status": 500,
  "message": ""
}

This never happened before only started after this language bug, when a list ends or there is no more cursor to give the cursor return empty string ""

@jbulava
Copy link
Member

jbulava commented Mar 6, 2020

This has been ticketed internally as VXL-822.

@jbulava jbulava added the ticketed Has been given an internal tracking ticket label Mar 6, 2020
@oliverfindl
Copy link
Author

Hello @jbulava,

it seems, that also broadcaster_language parameter stopped working tonight.
It's not clear to me, how we should perform queries for streams filtered by specific language(s) now. Recent rate limiting changes of #get-live-streams endpoint made it not possible to use (ineffective) workaround based on fetching all streams and then filter out streams within our target language(s).

Switching to Helix it's not acceptable because:

  • it looks like, it has its own issue with language parameter
  • it has issue/feature with pagination
  • it's missing other endpoints, that my website is using, e.g.: #get-top-clips - filtered by language parameter

It's there any ETA about fixing this issue?

Thanks

@fgl27
Copy link

fgl27 commented Mar 31, 2020

the query language is working now

$ curl -H 'Accept: application/vnd.twitchtv.v5+json' -H 'Client-ID: CLIENT_ID' -X GET 'https://api.twitch.tv/kraken/streams/?language=ru&limit=1'

{
	"streams": [{
		"_id": 1026335809,
		"game": "Counter-Strike: Global Offensive",
		"broadcast_platform": "live",
		"community_id": "",
		"community_ids": [],
		"viewers": 31152,
		"video_height": 1080,
		"average_fps": 59,
		"delay": 0,
		"created_at": "2020-03-31T11:57:58Z",
		"is_playlist": false,
		"stream_type": "live",
		"preview": {
			"small": "https://static-cdn.jtvnw.net/previews-ttv/live_user_csgomc_ru-80x45.jpg",
			"medium": "https://static-cdn.jtvnw.net/previews-ttv/live_user_csgomc_ru-320x180.jpg",
			"large": "https://static-cdn.jtvnw.net/previews-ttv/live_user_csgomc_ru-640x360.jpg",
			"template": "https://static-cdn.jtvnw.net/previews-ttv/live_user_csgomc_ru-{width}x{height}.jpg"
		},
		"channel": {
			"mature": false,
			"status": "[RU] Virtus.pro vs mousesports (0-1) BO3 | ESL PRO LEAGUE SEASON 11 by @__KvaN \u0026 @LeniniwTv",
			"broadcaster_language": "ru",
			"broadcaster_software": "",
			"display_name": "csgomc_ru",
			"game": "Counter-Strike: Global Offensive",
			"language": "ru",
			"_id": 213748641,
			"name": "csgomc_ru",
			"created_at": "2018-04-12T14:47:31.293685Z",
			"updated_at": "2020-03-31T18:26:12.794837Z",
			"partner": true,
			"logo": "https://static-cdn.jtvnw.net/jtv_user_pictures/4bf37688-7b19-4d3f-9d56-11740ad38c4d-profile_image-300x300.png",
			"video_banner": "https://static-cdn.jtvnw.net/jtv_user_pictures/bf17f22c-22e9-475c-a2cf-17cced913abd-channel_offline_image-1920x1080.png",
			"profile_banner": "https://static-cdn.jtvnw.net/jtv_user_pictures/9ee1d436-5aa4-482c-a33f-de7eb396315b-profile_banner-480.png",
			"profile_banner_background_color": "",
			"url": "https://www.twitch.tv/csgomc_ru",
			"views": 24068669,
			"followers": 331500,
			"broadcaster_type": "",
			"description": "",
			"private_video": false,
			"privacy_options_enabled": false
		}
	}]
}

only works for a single language as the doc says it suposed to be... tested for lives, vods and clips

@oliverfindl
Copy link
Author

Hello,

can confirm, it's working in my use-case.

Thanks.

@fgl27
Copy link

fgl27 commented Mar 31, 2020

Questions remains???

Is broadcaster_language dead and gone? for ever?

Will the 500 error from clips api be fixed? on the same issue?

Because it persist, can't load more then 100 clips when using a language.

curl -s \
-H "Accept: application/vnd.twitchtv.v5+json" \
-H "Client-ID: the-id" \
"https://api.twitch.tv/kraken/clips/top?limit=100&period=day&cursor=MTAw&language=en" \
| jq
{
  "error": "Internal Server Error",
  "status": 500,
  "message": ""
}

@bastimeyer
Copy link

Is broadcaster_language dead and gone?

Looks like it.

What's really sad is that previously, multiple language codes could be specified by separating them with a comma, and now with the removal of the broadcaster_language parameter, the only remaining option language doesn't support this and an empty list gets returned. Not to mention that language doesn't describe the stream's language, but the channel's language instead, which is wrong when searching for streams in a specific language.

@jbulava
Copy link
Member

jbulava commented May 28, 2020

Hi everyone, I wanted to follow up with more details. The v5 changes related to offset and _total announced in February, as a result of internal service changes, also affected the language parameter and that was a miss in communication.

To resolve the filtering issue reported here, the team deployed an update on March 30 that takes the language parameter you provide and uses that to filter on the broadcaster language associated with streams for the results.

@jbulava jbulava closed this as completed May 28, 2020
@oliverfindl oliverfindl changed the title Kraken API: streams endpoint - language query string parameter is ignored Kraken API: streams endpoint - "language" query string parameter is ignored Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: v5 API endpoints in the "v5" namespace ticketed Has been given an internal tracking ticket
Projects
None yet
Development

No branches or pull requests

4 participants