Skip to content

plugins.kick: refactor, fix clips + 403 API issues #6491

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
merged 1 commit into from
Mar 31, 2025

Conversation

bastimeyer
Copy link
Member

  • Fix clips matcher
  • Refactor API requests
  • Add missing API request headers and parse the User-Agent string

Some API requests might fail randomly and solving a JS challenge is required, similar to Twitch's client-integrity token. The JS challenge requirement however seems to be rare and subsequent API request attempts are almost always successful.


Fixes #6414

No issues while testing these URLs and lots of other in the past half an hour. But as said in the commit message, sometimes API requests will fail. It's possible that this is also timing-based, which I already suspected in previous PRs.

Either way, having these changes on master should already be an improvement.

Solving the JS challenge is a bit "challenging" when most API requests succeed without it being a requirement. I already had a plugin version which solved the challenge and stored all the cookies, as well as any request headers made by Chromium during the solve, but this didn't work when re-using the cookies and other headers on the API endpoints when using python-requests.


Non-existent channel

$ streamlink https://kick.com/dtcfuygvhbjulnkilm
[cli][info] Found matching plugin kick for URL kick.com/dtcfuygvhbjulnkilm
error: Error while querying Kick API: No query results for model [App\Models\Channel].

Offline channel

$ streamlink https://kick.com/admiralbulldog
[cli][info] Found matching plugin kick for URL kick.com/admiralbulldog
error: No playable streams found on this URL: kick.com/admiralbulldog

Live channel

$ streamlink https://kick.com/gabbidoto best
[cli][info] Found matching plugin kick for URL kick.com/gabbidoto
[cli][info] Available streams: 160p (worst), 360p, 480p, 720p60, 1080p60 (best)
[cli][info] Opening stream: 1080p60 (hls)
[cli][info] Starting player: /usr/bin/mpv
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...

invalid VOD

$ streamlink https://kick.com/admiralbulldog/videos/00000000-0000-0000-0000-000000000000 best
[cli][info] Found matching plugin kick for URL kick.com/admiralbulldog/videos/00000000-0000-0000-0000-000000000000
error: Error while querying Kick API: No query results for model [App\Models\Video].

VOD

$ streamlink https://kick.com/admiralbulldog/videos/f3fb7b26-1ad4-4d8d-8917-2c818f1e382b best
[cli][info] Found matching plugin kick for URL kick.com/admiralbulldog/videos/f3fb7b26-1ad4-4d8d-8917-2c818f1e382b
[cli][info] Available streams: 160p (worst), 360p, 480p, 720p60, 1080p60 (best)
[cli][info] Opening stream: 1080p60 (hls)
[cli][info] Starting player: /usr/bin/mpv
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...

invalid clip

$ streamlink https://kick.com/admiralbulldog?clip=clip_0000000000000000000000000 best
[cli][info] Found matching plugin kick for URL https://kick.com/admiralbulldog?clip=clip_0000000000000000000000000
error: Error while querying Kick API: Clip not found

clip

$ streamlink https://kick.com/admiralbulldog?clip=clip_01HSNHF69RPPR9JX0VQ6WM2YVC best
[cli][info] Found matching plugin kick for URL https://kick.com/admiralbulldog?clip=clip_01HSNHF69RPPR9JX0VQ6WM2YVC
[cli][info] Available streams: clip (worst, best)
[cli][info] Opening stream: clip (hls)
[cli][info] Starting player: /usr/bin/mpv
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...

$ streamlink https://kick.com/admiralbulldog/clips/clip_01HSNHF69RPPR9JX0VQ6WM2YVC best
[cli][info] Found matching plugin kick for URL https://kick.com/admiralbulldog/clips/clip_01HSNHF69RPPR9JX0VQ6WM2YVC
[cli][info] Available streams: clip (worst, best)
[cli][info] Opening stream: clip (hls)
[cli][info] Starting player: /usr/bin/mpv
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...

- Fix clips matcher
- Refactor API requests
- Add missing API request headers and parse the User-Agent string

Some API requests might fail randomly and solving a JS challenge
is required, similar to Twitch's client-integrity token.
The JS challenge requirement however seems to be rare and subsequent
API request attempts are almost always successful.
@bastimeyer bastimeyer added the plugin issue A Plugin does not work correctly label Mar 31, 2025
@bastimeyer bastimeyer merged commit c6528da into streamlink:master Mar 31, 2025
23 checks passed
@bastimeyer bastimeyer deleted the plugins/kick/refactor branch March 31, 2025 17:53
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.kick: 403 error
1 participant