streamlink / streamlink-twitch-gui

A multi platform Twitch.tv browser for Streamlink
https://streamlink.github.io/streamlink-twitch-gui/
MIT License
2.65k stars 199 forks source link

Browsing all streams only loads first page, button to fetch more is gone #744

Closed DOFandersolsen closed 2 years ago

DOFandersolsen commented 3 years ago

Bug report

Environment details

Operating system and version:
Windows 10 Pro, 1909

Streamlink Twitch GUI version:
v1.10.0

Streamlink version:
streamlink 1.4.1

Configuration details:
Windows is set to Danish I have set Streamlink Twitch GUI to filter out streams that are not in english

Description

When I click on Stream under Browse, I normally get a lot of streams, with a purple button allowing me to fetch/load more streams.

Now, I only get the initial list of streams with no option to load more.

Expected / Actual behavior

I expect to be able to see and click the "Fetch more streams" button at the end of the list since there are more than 48 english streams on Twitch.

Reproduction steps

  1. Install Streamlink Twitch GUI and Streamlink 2.Go to Settings -> Language
  2. Mark "Filter out streams"
  3. Check English (en)
  4. Click "Apply"
  5. Click on Streams under the Browse category

Log output

After launching Streamlink Twitch GUI and clicking on Streams under Browse, this is all the log contains

[2020-09-13T10:30:01.227Z][debug][Application]
Parameters
{
    "_": [],
    "tray": false,
    "hide": false,
    "hidden": false,
    "max": false,
    "maximize": false,
    "maximized": false,
    "min": false,
    "minimize": false,
    "minimized": false,
    "reset-window": false,
    "versioncheck": true,
    "version-check": true,
    "logfile": true,
    "loglevel": "debug",
    "l": "debug",
    "launch": "",
    "goto": ""
}

Additional comments, screenshots, etc.

bastimeyer commented 3 years ago

That's a Twitch API issue which is related to #707, twitchdev/issues#67, and it seems to be occurring once again.

The reason why the button disappears is that it thinks it's finished fetching data and that there isn't anything more to fetch. This happens when there is no metadata included in the API response and the returned number of requested records is lower than the requested one.

This seems to be only happening when a language parameter is set, but I'm not entirely sure.

Request examples:

# no language parameter, increasing offset
$ curl -s \
    -H "Accept: application/vnd.twitchtv.v5+json" \
    -H "Client-ID: phiay4sq36lfv9zu7cbqwz2ndnesfd8" \
    "https://api.twitch.tv/kraken/streams?offset=0&limit=12" \
    | jq "[.streams[]] | length"
12
$ curl -s \
      -H "Accept: application/vnd.twitchtv.v5+json" \
      -H "Client-ID: phiay4sq36lfv9zu7cbqwz2ndnesfd8" \
      "https://api.twitch.tv/kraken/streams?offset=12&limit=12" \
      | jq "[.streams[]] | length"
12
$ curl -s \
      -H "Accept: application/vnd.twitchtv.v5+json" \
      -H "Client-ID: phiay4sq36lfv9zu7cbqwz2ndnesfd8" \
      "https://api.twitch.tv/kraken/streams?offset=24&limit=12" \
      | jq "[.streams[]] | length"
12

# language=en, increasing offset
$ curl -s \
      -H "Accept: application/vnd.twitchtv.v5+json" \
      -H "Client-ID: phiay4sq36lfv9zu7cbqwz2ndnesfd8" \
      "https://api.twitch.tv/kraken/streams?offset=0&limit=12&language=en" \
      | jq "[.streams[]] | length"
12
$ curl -s \
      -H "Accept: application/vnd.twitchtv.v5+json" \
      -H "Client-ID: phiay4sq36lfv9zu7cbqwz2ndnesfd8" \
      "https://api.twitch.tv/kraken/streams?offset=12&limit=12&language=en" \
      | jq "[.streams[]] | length"
12
$ curl -s \
      -H "Accept: application/vnd.twitchtv.v5+json" \
      -H "Client-ID: phiay4sq36lfv9zu7cbqwz2ndnesfd8" \
      "https://api.twitch.tv/kraken/streams?offset=24&limit=12&language=en" \
      | jq "[.streams[]] | length"
11
bastimeyer commented 3 years ago

Reported here: twitchdev/issues#221

DOFandersolsen commented 3 years ago

I don't know if Twitch has deployed a hotfix, but the issue has been resolved and the pagination now works again without me having to update or change anything.

bastimeyer commented 3 years ago

No, they haven't fixed anything yet, especially on a Sunday.

This issue is coming and going in certain time intervals for some reason. This was the case previously as well and some of the Twitch devs couldn't even reproduce the issue when I reported it earlier this year (on the dev forums). It may even vary from region to region if they have differences or delays in their dynamic server/database deployments, who knows.

Until I get a proper response from them on the linked thread, I will leave this one open. Let's hope there will be a response, because I still have another issue open there without one.

magnify8 commented 3 years ago

I am experiencing same issue and haven't fıgure out any solution

bastimeyer commented 2 years ago

Closing, as this is an issue with the old kraken API. This will be fixed with the helix API (#849).