plugins.youtube: cookies passed but LOGIN_REQUIRED: Sign in to confirm you’re not a bot
Checklist
- This is a plugin issue and not a different kind of issue
- I have read the contribution guidelines
- I have checked the list of open and recently closed plugin issues
- I have checked the commit log of the master branch
Collaboration
Streamlink version
8.4.0
Description
Hello,
I'm trying to record a Youtube regular stream or age-restricted by uploader stream from an IP address triggering Youtube bot detection. Following yt-dlp method I logged in to Youtube, exported my brower cookies in Netscape format to a cookies.txt file. With yt-dlp, without cookies it throws error : ERROR: [youtube] Sign in to confirm you’re not a bot. Use --cookies-from-browser or --cookies for the authentication If I pass cookie file with --cookies cookies.txt it works. With streamink, with or without cookies (--http-cookies-file cookies.txt) it throws error : [plugins.youtube][error] Could not get video info - LOGIN_REQUIRED: Sign in to confirm you’re not a bot Recording chat messages with chat_downloader : without cookies : "Unable to parse initial video data". With cookies (--cookies cookies.txt) it works.
If I try to record with streamlink and yt-dlp without cookies file same streams from same computer without VPN or from a shared hoster, it works. I guess it's because these IP address are considered as clean by Youtube and don't require login.
It's the first time I try cookies auth with streamlink. I also tried passing http-cookie values to streamlink in a config file issue is the same.
Log shown is from an age-restricted by uploader stream I created.
Debug/trace log
streamlink --http-cookies-file c:\\\users\XXX\desktop\cookies.txt --loglevel all https://www.youtube.com/watch?v=hNWUj3mc3lw worst
[13:55:11.107067][MainThread][session][debug] Loading plugin: youtube
[13:55:12.089751][MainThread][cli][debug] OS: Windows 11
[13:55:12.090194][MainThread][cli][debug] Python: 3.13.4
[13:55:12.090596][MainThread][cli][debug] OpenSSL: OpenSSL 3.0.16 11 Feb 2025
[13:55:12.090959][MainThread][cli][debug] Streamlink: 8.4.0
[13:55:12.091324][MainThread][cli][debug] Dependencies:
[13:55:12.097027][MainThread][cli][debug] certifi: 2025.10.5
[13:55:12.099572][MainThread][cli][debug] isodate: 0.7.2
[13:55:12.103175][MainThread][cli][debug] lxml: 6.0.2
[13:55:12.108797][MainThread][cli][debug] pycountry: 24.6.1
[13:55:12.111188][MainThread][cli][debug] pycryptodome: 3.23.0
[13:55:12.113670][MainThread][cli][debug] PySocks: 1.7.1
[13:55:12.115942][MainThread][cli][debug] requests: 2.32.5
[13:55:12.119830][MainThread][cli][debug] trio: 0.30.0
[13:55:12.127182][MainThread][cli][debug] trio-websocket: 0.12.2
[13:55:12.129637][MainThread][cli][debug] typing-extensions: 4.15.0
[13:55:12.132468][MainThread][cli][debug] urllib3: 2.5.0
[13:55:12.137113][MainThread][cli][debug] websocket-client: 1.8.0
[13:55:12.142718][MainThread][cli][debug] Arguments:
[13:55:12.143172][MainThread][cli][debug] url=https://www.youtube.com/watch?v=hNWUj3mc3lw
[13:55:12.143546][MainThread][cli][debug] stream=['worst']
[13:55:12.143880][MainThread][cli][debug] --loglevel=all
[13:55:12.144303][MainThread][cli][debug] --ffmpeg-ffmpeg=C:\Program Files\Streamlink\ffmpeg\ffmpeg.exe
[13:55:12.144680][MainThread][cli][debug] --http-cookies-file=['c:\\\\users\\XXX\\desktop\\cookies.txt']
[13:55:12.147334][MainThread][cli][info] Found matching plugin youtube for URL https://www.youtube.com/watch?v=hNWUj3mc3lw
[13:55:12.147928][MainThread][cache][trace] Loading cache file: C:\Users\XXX\AppData\Roaming\streamlink\plugin-cache.json
[13:55:14.959702][MainThread][plugins.youtube][error] Could not get video info - LOGIN_REQUIRED: Sign in to confirm you’re not a bot
error: No playable streams found on this URL: https://www.youtube.com/watch?v=hNWUj3mc3lwyt-dlp --cookies c:\\\users\XXX\desktop\cookies.txt --remote-components ejs:github -S "res:480" https://www.youtube.com/watch?v=hNWUj3mc3lw
[youtube] Extracting URL: https://www.youtube.com/watch?v=hNWUj3mc3lw
[youtube] hNWUj3mc3lw: Downloading webpage
[youtube] hNWUj3mc3lw: Downloading tv downgraded player API JSON
[youtube] hNWUj3mc3lw: Downloading player 886cbf26-main
[youtube] [jsc:deno] Solving JS challenges using deno
[youtube] hNWUj3mc3lw: Downloading m3u8 information
[info] hNWUj3mc3lw: Downloading 1 format(s): 94
[download] Destination: 020626-6 2026-06-02 14_01 [hNWUj3mc3lw].mp4
[hls @ 0000025072f56200] Opening 'XXX/seg.ts' for reading
[ffmpeg] Interrupted by userSource: streamlink/streamlink