Skip to content

plugins.kick: solve JS challenge #6500

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
Apr 26, 2025

Conversation

bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Apr 17, 2025

Kick once again returns 403 HTTP responses on their API with the current plugin version on master.

Solving the JS challenge and using the resulting cookies should work. This is now the third or fourth attempt of me implementing this, because the previous PRs all turned out to be unnecessary. I however could verify a few minutes ago before my IP address once again got whitelisted that accessing the API with the JS challenge cookies works. Whether it's unnecessary again because of some missing HTTP headers, like twice previously, I don't know. But since I got whitelisted again, I can't verify this, because even master works again from my end.

I'd therefore very much appreciate PR feedback from anyone. Please give this a quick try.
https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#pull-request-feedback

My patience with this plugin is about to run out though. Weird coincidence that the plugin breaks as soon as a fix has been published, several times now. Also, if I don't get any feedback on this, I'm tempted to simply remove the plugin and be done with it.


$ streamlink kick.com/admiralbulldog -l debug best
[cli][debug] OS:         Linux-6.14.0-1-git-x86_64-with-glibc2.41
[cli][debug] Python:     3.13.2
[cli][debug] OpenSSL:    OpenSSL 3.5.0 8 Apr 2025
[cli][debug] Streamlink: 7.2.0+13.gf4e156c6
[cli][debug] Dependencies:
[cli][debug]  certifi: 2024.12.14
[cli][debug]  isodate: 0.7.2
[cli][debug]  lxml: 5.3.0
[cli][debug]  pycountry: 24.6.1
[cli][debug]  pycryptodome: 3.21.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.32.3
[cli][debug]  trio: 0.27.0
[cli][debug]  trio-websocket: 0.11.1
[cli][debug]  urllib3: 2.3.0
[cli][debug]  websocket-client: 1.8.0
[cli][debug] Arguments:
[cli][debug]  url=kick.com/admiralbulldog
[cli][debug]  stream=['best']
[cli][debug]  --loglevel=debug
[cli][debug]  --player=/usr/bin/mpv
[cli][debug]  --webbrowser-headless=True
[cli][info] Found matching plugin kick for URL kick.com/admiralbulldog
[plugins.kick][info] Solving JS challenge
[webbrowser.webbrowser][info] Launching web browser: /usr/bin/chromium (headless=True)
[webbrowser.webbrowser][debug] Waiting for web browser process to terminate
[plugins.kick][info] JS challenge solved, storing cookies
[plugins.kick][debug] Saved cookies: __cf_bm, XSRF-TOKEN, VsNsDegclIi9RLXdjf3AvMoRGvzmLZ952YK06lA8, cf_clearance, oWW5T2IepwOeNCOLNvP8DvgIGvYdvNOFabuk6U7Y, _ga, USER_LOCALE, _gcl_au, kick_session, OYK2C5XMwVCFWL2bsDVPcH1vEpTJLrCQbgmAkuPb, _ga_YS2DLSGQ53, WTgwHuSH4izmHCAE5acvNCF7WOFQAZBnPDZhSqBh, _cfuvid, KP_UIDz, _dd_s, volume, KP_UIDz-ssn
[utils.l10n][debug] Language code: en_US
[cli][info] Available streams: 160p (worst), 360p, 480p, 720p60, 1080p60 (best)
[cli][info] Opening stream: 1080p60 (hls)
[cli][info] Starting player: /usr/bin/mpv
[stream.hls][debug] Reloading playlist
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] First Sequence: 4050; Last Sequence: 4056
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 4054; End Sequence: None
[stream.hls][debug] Adding segment 4054 to queue
[stream.hls][debug] Adding segment 4055 to queue
[stream.hls][debug] Adding segment 4056 to queue
[stream.hls][debug] Writing segment 4054 to output
[stream.hls][debug] Segment 4054 complete
[cli.output][debug] Opening subprocess: ['/usr/bin/mpv', '--force-media-title=kick.com/admiralbulldog', '-']
[stream.hls][debug] Writing segment 4055 to output
[stream.hls][debug] Segment 4055 complete
[stream.hls][debug] Writing segment 4056 to output
[stream.hls][debug] Segment 4056 complete
[cli][debug] Writing stream to output
[cli][info] Player closed
[stream.segmented][debug] Closing worker thread
[stream.segmented][debug] Closing writer thread
[cli][info] Stream ended
[cli][info] Closing currently open stream...

@bastimeyer bastimeyer added the plugin issue A Plugin does not work correctly label Apr 17, 2025
@gravyboat
Copy link
Member

gravyboat commented Apr 17, 2025

My patience with this plugin is about to run out though. Weird coincidence that the plugin breaks as soon as a fix has been published, several times now. Also, if I don't get any feedback on this, I'm tempted to simply remove the plugin and be done with it.

I would be in favor of this. It's been nothing but a headache and the people who want it fixed rarely test the fixes. Waste of time and energy to keep addressing. I'm not willing to test it as I despise kick and never use it so it's all on the people who report the problem to give this a shot.

@bastimeyer bastimeyer merged commit 8d0a700 into streamlink:master Apr 26, 2025
23 checks passed
@bastimeyer bastimeyer deleted the plugins/kick/js-challenge branch April 26, 2025 19:33
@Robby-
Copy link

Robby- commented May 21, 2025

Sad to see the hate against Kick, but for what its worth, I'm testing this commit right now and it is working fine. Thank you, the 403's were a problem, but not anymore.

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.

3 participants