yt-dlp: kick.com videos - HTTP Error 403: Forbidden

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

Sweden

Provide a description that is worded well enough to be understood

Yt-dlp gets stuck on a 403 forbidden error on kick.com video sites. The site still works and plays in browser but I do get redirected via a cloudflare site which I’m suspecting is the problem. The website version works and plays the video without requiring login on Firefox and Chrome. I’m on the latest 2023.03.04 version of yt-dlp.

Debugging attempts: Using session cookies via --cookies cookies.txt downloaded through a browser extension does not work. Still getting a 403 error.

Forcing the user agent to be Mozilla via --user-agent “Mozilla/5.0” has no effect. Still getting a 403 error.

Grabbing the m3u8 stream from inspecting memory in browser and downloading it via yt-dlp that way works i.e: yt-dlp https://stream.kick.com/ivs/v1/196233775518/LfDRYYsAP6oJ/2023/4/8/2/37/iddbzqX5UQuJ/media/hls/master.m3u8

Hence it seems to not be able to resolve the website.

If there is a way to resolve cloudflare I could not find it in the issue tracker and if I missed it I apologize, I don’t mean to waste anyone’s time. Thank you for all your hard work!

How to reproduce: yt-dlp https://kick.com/video/234e331d-f8bd-4935-b72d-0ec5354a652e

Output including error: [generic] 234e331d-f8bd-4935-b72d-0ec5354a652e: Downloading webpage ERROR: [generic] Unable to download webpage: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

yt-dlp https://kick.com/video/234e331d-f8bd-4935-b72d-0ec5354a652e -vU
[debug] Command-line config: ['https://kick.com/video/234e331d-f8bd-4935-b72d-0ec5354a652e', '-vU']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.11.11 [8b64402] (pip)
[debug] Python 3.9.6 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 2020-12-15-git-32586a42da-full_build-www.gyan.dev, ffprobe 2020-12-15-git-32586a42da-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.16.0, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1723 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.03.04, Current version: 2022.11.11
[debug] Downloading _update_spec from https://github.com/yt-dlp/yt-dlp/releases/download/2023.03.04/_update_spec
ERROR: You installed yt-dlp with pip or using the wheel from PyPi; Use that to update
[debug] [generic] Extracting URL: https://kick.com/video/234e331d-f8bd-4935-b72d-0ec5354a652e
[generic] 234e331d-f8bd-4935-b72d-0ec5354a652e: Downloading webpage
ERROR: [generic] Unable to download webpage: HTTP Error 403: Forbidden (caused by <HTTPError 403: 'Forbidden'>); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "c:\python39\lib\site-packages\yt_dlp\extractor\common.py", line 674, in extract
    ie_result = self._real_extract(url)
  File "c:\python39\lib\site-packages\yt_dlp\extractor\generic.py", line 2582, in _real_extract
    full_response = self._request_webpage(url, video_id, headers={
  File "c:\python39\lib\site-packages\yt_dlp\extractor\common.py", line 825, in _request_webpage
    raise ExtractorError(errmsg, cause=err)

  File "c:\python39\lib\site-packages\yt_dlp\extractor\common.py", line 807, in _request_webpage
    return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query))
  File "c:\python39\lib\site-packages\yt_dlp\YoutubeDL.py", line 3692, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "c:\python39\lib\urllib\request.py", line 523, in open
    response = meth(req, response)
  File "c:\python39\lib\urllib\request.py", line 632, in http_response
    response = self.parent.error(
  File "c:\python39\lib\urllib\request.py", line 561, in error
    return self._call_chain(*args)
  File "c:\python39\lib\urllib\request.py", line 494, in _call_chain
    result = func(*args)
  File "c:\python39\lib\urllib\request.py", line 641, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 4
  • Comments: 71 (12 by maintainers)

Most upvoted comments

workaround for now is to add --legacy-server-connect to your command

Could you elaborate on how this works?

Cloudflare seem to have blocked it 😦

Here’s a new automated workaround (once again, the manual workaround is documented here)

  1. download curl-impersonate a. MacOS: download this link b. Linux: download one of the top 3 files here. Run uname -m to find out which one c. Windows: curl-impersonate-win
  2. extract the folder, and copy the below files to the same folder as yt-dlp (you may discard the remain files): a. MacOS and Linux: curl_chrome110 and curl-impersonate-chrome b. Windows: all the files, I guess
  3. you can now run the below commands to download videos from kick.com. The only part you need to modify is URL in the yt-dlp command (and the file name, if you don’t like kickcomcookies.txt for some reason)
curl_chrome110 https://kick.com/ -c kickcomcookies.txt
yt-dlp --add-header "User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36" --cookies kickcomcookies.txt URL

React with a 👍 if it worked 😃

I’ve pushed a change to the Kick extractor. Now it will continue to try to extract the video if the first request fails.

Here’s what you can try:

  1. With your yt-dlp win exe, run yt-dlp --update-to nightly

  2. Try yt-dlp -v https://kick.com/video/234e331d-f8bd-4935-b72d-0ec5354a652e

  3. If that fails, then try navigating to the site in your browser, and passing cookies from browser to yt-dlp: yt-dlp -v --cookies-from-browser chrome https://kick.com/video/234e331d-f8bd-4935-b72d-0ec5354a652e (or replace chrome with whatever browser you visit kick.com with)

  4. If the above also fails, then find your browser’s user-agent string (you can type “what is my user-agent” into duckduckgo or google), and try running: yt-dlp -v --user-agent "USER_AGENT" --cookies-from-browser chrome https://kick.com/video/234e331d-f8bd-4935-b72d-0ec5354a652e (replace USER_AGENT with your actual user-agent string)

If successful, please reply with which worked for you (2, 3 or 4)

If you are still getting an error, please post the verbose log as text

and you will have to (manually) navigate to Kick in a browser again

Obviously still not reliable for livestreams, but if you have curl installed (winget install curl) you can run the following to automate it:

curl https://kick.com/ -c kickdotcomcookies.txt -H "User-Agent: ujhgtfjhgfbv"
yt-dlp https://kick.com --cookies kickdotcomcookies.txt --add-header "User-Agent: ujhgtfjhgfbv"

ujhgtfjhgfbv is a random string from me banging my keyboard. i’d recommend replacing it (in both commands) since I expect it to get blocked after I post this

I’ve pushed a change to the Kick extractor. Now it will continue to try to extract the video if the first request fails.

Here’s what you can try:

  1. With your yt-dlp win exe, run yt-dlp --update-to nightly
  2. Try yt-dlp -v https://kick.com/video/234e331d-f8bd-4935-b72d-0ec5354a652e
  3. If that fails, then try navigating to the site in your browser, and passing cookies from browser to yt-dlp: yt-dlp -v --cookies-from-browser chrome https://kick.com/video/234e331d-f8bd-4935-b72d-0ec5354a652e (or replace chrome with whatever browser you visit kick.com with)
  4. If the above also fails, then find your browser’s user-agent string (you can type “what is my user-agent” into duckduckgo or google), and try running: yt-dlp -v --user-agent "USER_AGENT" --cookies-from-browser chrome https://kick.com/video/234e331d-f8bd-4935-b72d-0ec5354a652e (replace USER_AGENT with your actual user-agent string)

If successful, please reply with which worked for you (2, 3 or 4)

If you are still getting an error, please post the verbose log as text

Thank you so much! Step 4 worked for me after trying the previous steps.

workaround for now is to add --legacy-server-connect to your command

is this safe to use, Is RFC 5746 secure renegotiation important? (like would it be similar to accessing a webpage over http where it could have been tampered with? )

You’re literally downloading silly videos with meaningless streamers and e-girls, not your bank account. Relax.

Website works but yt-dlp gets 403’d with the latest nightly.

However, you can still download the VOD by getting the master m3u8 and plugging that into yt-dlp as described in this video guide.

https://streamable.com/xbel1y

note that #7595 (curl_cffi) still works

$ yt-dlp --ignore-config --impersonate chrome -vF 'https://kick.com/video/dd8c8125-cf6b-46c8-ad87-770507c389ec'
[debug] Command-line config: ['--ignore-config', '--impersonate', 'chrome', '-vF', 'https://kick.com/video/dd8c8125-cf6b-46c8-ad87-770507c389ec']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.11.16 from yt-dlp/yt-dlp [24f827875]
[debug] Lazy loading extractors is disabled
[debug] Python 3.11.6 (CPython x86_64 64bit) - Linux-6.6.4-arch1-1-x86_64-with-glibc2.38 (OpenSSL 3.1.4 24 Oct 2023, glibc 2.38)
[debug] exe versions: ffmpeg 6.1 (setts), ffprobe 6.1
[debug] Optional libraries: Cryptodome-3.12.0, brotlicffi-1.1.0.0, certifi-2023.11.17, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.31.0, sqlite3-3.44.2, urllib3-2.1.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1915 extractors
[KickVOD] Setting up session
[KickVOD] Extracting URL: https://kick.com/video/dd8c8125-cf6b-46c8-ad87-770507c389ec
[KickVOD] dd8c8125-cf6b-46c8-ad87-770507c389ec: Downloading API JSON
[KickVOD] dd8c8125-cf6b-46c8-ad87-770507c389ec: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for dd8c8125-cf6b-46c8-ad87-770507c389ec:
ID      EXT RESOLUTION FPS │  FILESIZE   TBR PROTO │ VCODEC      ACODEC
──────────────────────────────────────────────────────────────────────────
160p    mp4 284x160     30 │ ~ 1.73GiB  230k m3u8  │ avc1.4D401F mp4a.40.2
360p    mp4 640x360     30 │ ~ 4.74GiB  630k m3u8  │ avc1.4D401F mp4a.40.2
480p    mp4 852x480     30 │ ~12.50GiB 1663k m3u8  │ avc1.4D401F mp4a.40.2
720p60  mp4 1280x720    60 │ ~27.50GiB 3658k m3u8  │ avc1.4D401F mp4a.40.2
1080p60 mp4 1920x1080   60 │ ~54.81GiB 7291k m3u8  │ avc1.64002A mp4a.40.2

@RevSnowfox #7595 will most likely fix it

For those who don’t want to go through the message history, here’s an automated workaround, and here’s a manual workaround

still works for me, your ip[|range] may be blacklisted.

Nobody is getting IP blacklisted. They’re just not using the master.m3u8 link from the public-facing link.

does --legacy-server-connect help with this issue?

this appears to fix the issue. just re-verified that the regular approach results in 403, adding --legacy-server-connect results in successful download.