Skip to content

plugins.twitch: remove is-live API check #5708

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

Merged

Conversation

bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Dec 5, 2023

Resolves #5707

Let's remove the is-live API check again (added in #5704), for the sake of being able to start streams just after they've gone live. Twitch's GQL API has delayed data (up to a minute or so), so having this check implemented isn't ideal. It does prevent the empty metadata issue though, but I don't think it's important.

The second commit which is included here removes an unnecessary error message for offline channels, but only in those cases where no JSON data was returned by the multivariant playlist error response. I will have a look later at checking the API for offline channels after the playlist has returned 4xx. No idea about geo-blocked content yet though, which was the reason for parsing the JSON data.


Online channel (listing streams now takes a bit longer due to check_streams=True)

$ streamlink twitch.tv/shroud
[cli][info] Found matching plugin twitch for URL twitch.tv/shroud
Available streams: audio_only, 160p (worst), 360p, 480p, 720p, 720p60, 1080p60 (best)

Offline channel with bad data on Twitch's end is now actually offline (due to check_streams=True)

$ streamlink twitch.tv/paymoneywubby
[cli][info] Found matching plugin twitch for URL twitch.tv/paymoneywubby
error: No playable streams found on this URL: twitch.tv/paymoneywubby

Offline channel with JSON data in HLS multivariant playlist response (still garbage error log message)

$ streamlink twitch.tv/eslcs
[cli][info] Found matching plugin twitch for URL twitch.tv/eslcs
[plugins.twitch][error] twirp error not_found: transcode does not exist
error: No playable streams found on this URL: twitch.tv/eslcs

Offline channel without JSON data in HLS multivariant playlist response (no more unnecessary error log message)

$ streamlink twitch.tv/dota2ti_4
[cli][info] Found matching plugin twitch for URL twitch.tv/dota2ti_4
error: No playable streams found on this URL: twitch.tv/dota2ti_4

Instead, check if media playlists are accessible, so that we're not
limited by Twitch's delayed API data when a channel has just gone live.
When the error-response of the HLS multivariant playlist didn't return
JSON data, then don't log a useless error message.
@bastimeyer bastimeyer added the plugin issue A Plugin does not work correctly label Dec 5, 2023
@bastimeyer
Copy link
Member Author

@Hakkin

@Hakkin
Copy link
Contributor

Hakkin commented Dec 5, 2023

Can confirm this fixes the issue, the delay from having to check the playlists also seems to be minimal.

@bastimeyer bastimeyer merged commit d581018 into streamlink:master Dec 6, 2023
@bastimeyer bastimeyer deleted the plugins/twitch/remove-is-live-check branch December 6, 2023 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin issue A Plugin does not work correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plugins.twitch: Returns "Channel is offline" for short period after a stream has started
2 participants