-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Description
Checklist
- I'm reporting that yt-dlp is broken on a supported site
- I've verified that I have updated yt-dlp to nightly or master (update instructions)
- I've checked that all provided URLs are playable in a browser with the same IP and same login details
- I've checked that all URLs and arguments with special characters are properly quoted or escaped
- I've searched known issues, the FAQ, and the bugtracker for similar issues including closed ones. DO NOT post duplicates
- I've read about sharing account credentials and I'm willing to share it if required
Region
Czech Republic
Provide a description that is worded well enough to be understood
When I attempt to download a section of YT video with --download-sections
and HTTP proxy enabled, I get Server returned 400 Bad Request
from ffmpeg.
[debug] Command-line config: ['--proxy', 'http://xxx:@api.zyte.com:8011', '--no-check-certificate', '-vU', '--download-sections', '*30-31', 'https://www.youtube.com/watch?v=McVP8SZl-cw']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2025.04.06.232826 from yt-dlp/yt-dlp-nightly-builds [74e90dd9b] (pip)
[debug] Python 3.11.8 (CPython x86_64 64bit) - Linux-6.5.0-1024-aws-x86_64-with-glibc2.35 (OpenSSL 3.0.2 15 Mar 2022, glibc 2.35)
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2023.07.22, mutagen-1.47.0, requests-2.32.3, sqlite3-3.37.2, urllib3-2.0.7, websockets-15.0
[debug] Proxy map: {'all': 'http://xxx:@api.zyte.com:8011'}
[debug] Request Handlers: urllib, requests, websockets
[debug] Plugin directories: none
[debug] Loaded 1856 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2025.04.06.232826 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2025.04.06.232826 from yt-dlp/yt-dlp-nightly-builds)
[youtube] Extracting URL: https://www.youtube.com/watch?v=McVP8SZl-cw
[youtube] McVP8SZl-cw: Downloading webpage
[youtube] McVP8SZl-cw: Downloading tv client config
[youtube] McVP8SZl-cw: Downloading tv player API JSON
[youtube] McVP8SZl-cw: Downloading ios player API JSON
[debug] Loading youtube-nsig.64be519f-main from cache
[debug] [youtube] Decrypted nsig H2bPSeW1QCbkbnNxF => OfkCvNs_RL5M1g
[debug] [youtube] Decrypted nsig aL91cMKNi0V4eXJ5I => PBPq18nL3N1ffg
[debug] [youtube] McVP8SZl-cw: ios client https formats require a GVS PO Token which was not provided. They will be skipped as they may yield HTTP Error 403. You can manually pass a GVS PO Token for this client with --extractor-args "youtube:po_token=ios.gvs+XXX". For more information, refer to https://github.com/yt-dlp/yt-dlp/wiki/PO-Token-Guide . To enable these broken formats anyway, pass --extractor-args "youtube:formats=missing_pot"
[youtube] McVP8SZl-cw: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec, channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] McVP8SZl-cw: Downloading 1 format(s): 137+251
[info] McVP8SZl-cw: Downloading 1 time ranges: 30.0-31.0
[debug] Invoking ffmpeg downloader on "https://rr2---sn-najern7r.googlevideo.com/videoplayback?expire=1744729165&ei=7R_-Z7TnLK6Y2_gPhLjv6Ag&ip=181.215.217.101&id=o-AAk4v2i8e5qnMb2OuwR7E_23ZvMxIp4M8okSBbKLRkiR&itag=137&aitags=134%2C136%2C137%2C160%2C243&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1744707565%2C&mh=6D&mm=31%2C26&mn=sn-najern7r%2Csn-a5mlrnek&ms=au%2Conr&mv=u&mvi=2&pl=24&rms=au%2Cau&bui=AccgBcMP_BImni1c8rETIQSuUs2AVTcCvjtMsazCLOUHS_5xWR_k2SxlUGqN6_kj7YKCfzD-vgwXU32r&spc=_S3wKs6BUfvwlPJ0fS7dfAx4jVX0KaChfxnPN14_uufp5k8KZ9jM_Bjw20PtiV7MWIvBYw&vprv=1&svpuc=1&mime=video%2Fmp4&ns=cz8Nxunp1rHSguoo1wcrzEgQ&rqh=1&gir=yes&clen=90307538&dur=363.096&lmt=1715997843891502&mt=1744707009&fvip=5&keepalive=yes&lmw=1&c=TVHTML5&sefc=1&txp=8219224&n=PBPq18nL3N1ffg&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgHjOhp359MGghHl5hD7-RoKLQlKeOFM4Q4g000vgWpxcCIHnOxkQtrQDA53aR7EVcdRENKUWaryWKpBh1ErwVQcRE&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms&lsig=ACuhMU0wRQIgZ0XmiLxruqBgYHRknVlIBAm4hxdyoGHOhMMNLVAV8HgCIQCcDoVNTiG8GM4_cJaGHXdM95Lg2RGy2Dh6-bHGlHQa2w%3D%3D", "https://rr2---sn-najern7r.googlevideo.com/videoplayback?expire=1744729165&ei=7R_-Z7TnLK6Y2_gPhLjv6Ag&ip=181.215.217.101&id=o-AAk4v2i8e5qnMb2OuwR7E_23ZvMxIp4M8okSBbKLRkiR&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1744707565%2C&mh=6D&mm=31%2C26&mn=sn-najern7r%2Csn-a5mlrnek&ms=au%2Conr&mv=u&mvi=2&pl=24&rms=au%2Cau&bui=AccgBcMP_BImni1c8rETIQSuUs2AVTcCvjtMsazCLOUHS_5xWR_k2SxlUGqN6_kj7YKCfzD-vgwXU32r&spc=_S3wKs6BUfvwlPJ0fS7dfAx4jVX0KaChfxnPN14_uufp5k8KZ9jM_Bjw20PtiV7MWIvBYw&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=cz8Nxunp1rHSguoo1wcrzEgQ&rqh=1&gir=yes&clen=6001835&dur=363.141&lmt=1715997785896416&mt=1744707009&fvip=5&keepalive=yes&lmw=1&c=TVHTML5&sefc=1&txp=8218224&n=PBPq18nL3N1ffg&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgcDcVFt_nkDK4gsRkCYyWny34v_MfbNPHqKteyOnqmzYCIA-_EWSeiDSLF_fYydqidKqUsvJVezhMsSRAlp4su80r&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms&lsig=ACuhMU0wRQIgZ0XmiLxruqBgYHRknVlIBAm4hxdyoGHOhMMNLVAV8HgCIQCcDoVNTiG8GM4_cJaGHXdM95Lg2RGy2Dh6-bHGlHQa2w%3D%3D"
[download] Destination: Proven Benefits Of Ashwaganda [McVP8SZl-cw].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Sec-Fetch-Mode: navigate
' -ss 30.0 -t 1.0 -i 'https://rr2---sn-najern7r.googlevideo.com/videoplayback?expire=1744729165&ei=7R_-Z7TnLK6Y2_gPhLjv6Ag&ip=181.215.217.101&id=o-AAk4v2i8e5qnMb2OuwR7E_23ZvMxIp4M8okSBbKLRkiR&itag=137&aitags=134%2C136%2C137%2C160%2C243&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1744707565%2C&mh=6D&mm=31%2C26&mn=sn-najern7r%2Csn-a5mlrnek&ms=au%2Conr&mv=u&mvi=2&pl=24&rms=au%2Cau&bui=AccgBcMP_BImni1c8rETIQSuUs2AVTcCvjtMsazCLOUHS_5xWR_k2SxlUGqN6_kj7YKCfzD-vgwXU32r&spc=_S3wKs6BUfvwlPJ0fS7dfAx4jVX0KaChfxnPN14_uufp5k8KZ9jM_Bjw20PtiV7MWIvBYw&vprv=1&svpuc=1&mime=video%2Fmp4&ns=cz8Nxunp1rHSguoo1wcrzEgQ&rqh=1&gir=yes&clen=90307538&dur=363.096&lmt=1715997843891502&mt=1744707009&fvip=5&keepalive=yes&lmw=1&c=TVHTML5&sefc=1&txp=8219224&n=PBPq18nL3N1ffg&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgHjOhp359MGghHl5hD7-RoKLQlKeOFM4Q4g000vgWpxcCIHnOxkQtrQDA53aR7EVcdRENKUWaryWKpBh1ErwVQcRE&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms&lsig=ACuhMU0wRQIgZ0XmiLxruqBgYHRknVlIBAm4hxdyoGHOhMMNLVAV8HgCIQCcDoVNTiG8GM4_cJaGHXdM95Lg2RGy2Dh6-bHGlHQa2w%3D%3D' -headers 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Sec-Fetch-Mode: navigate
' -ss 30.0 -t 1.0 -i 'https://rr2---sn-najern7r.googlevideo.com/videoplayback?expire=1744729165&ei=7R_-Z7TnLK6Y2_gPhLjv6Ag&ip=181.215.217.101&id=o-AAk4v2i8e5qnMb2OuwR7E_23ZvMxIp4M8okSBbKLRkiR&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1744707565%2C&mh=6D&mm=31%2C26&mn=sn-najern7r%2Csn-a5mlrnek&ms=au%2Conr&mv=u&mvi=2&pl=24&rms=au%2Cau&bui=AccgBcMP_BImni1c8rETIQSuUs2AVTcCvjtMsazCLOUHS_5xWR_k2SxlUGqN6_kj7YKCfzD-vgwXU32r&spc=_S3wKs6BUfvwlPJ0fS7dfAx4jVX0KaChfxnPN14_uufp5k8KZ9jM_Bjw20PtiV7MWIvBYw&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=cz8Nxunp1rHSguoo1wcrzEgQ&rqh=1&gir=yes&clen=6001835&dur=363.141&lmt=1715997785896416&mt=1744707009&fvip=5&keepalive=yes&lmw=1&c=TVHTML5&sefc=1&txp=8218224&n=PBPq18nL3N1ffg&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgcDcVFt_nkDK4gsRkCYyWny34v_MfbNPHqKteyOnqmzYCIA-_EWSeiDSLF_fYydqidKqUsvJVezhMsSRAlp4su80r&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms&lsig=ACuhMU0wRQIgZ0XmiLxruqBgYHRknVlIBAm4hxdyoGHOhMMNLVAV8HgCIQCcDoVNTiG8GM4_cJaGHXdM95Lg2RGy2Dh6-bHGlHQa2w%3D%3D' -c copy -map 0:0 -map 1:0 -f matroska 'file:Proven Benefits Of Ashwaganda [McVP8SZl-cw].mkv.part'
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
[tcp @ 0x5c60047cb140] Starting connection attempt to 129.153.143.113 port 8011
[tcp @ 0x5c60047cb140] Successfully connected to 129.153.143.113 port 8011
[httpproxy @ 0x5c60047c8580] HTTP error 400 Bad request
https://rr2---sn-najern7r.googlevideo.com/videoplayback?expire=1744729165&ei=7R_-Z7TnLK6Y2_gPhLjv6Ag&ip=181.215.217.101&id=o-AAk4v2i8e5qnMb2OuwR7E_23ZvMxIp4M8okSBbKLRkiR&itag=137&aitags=134%2C136%2C137%2C160%2C243&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1744707565%2C&mh=6D&mm=31%2C26&mn=sn-najern7r%2Csn-a5mlrnek&ms=au%2Conr&mv=u&mvi=2&pl=24&rms=au%2Cau&bui=AccgBcMP_BImni1c8rETIQSuUs2AVTcCvjtMsazCLOUHS_5xWR_k2SxlUGqN6_kj7YKCfzD-vgwXU32r&spc=_S3wKs6BUfvwlPJ0fS7dfAx4jVX0KaChfxnPN14_uufp5k8KZ9jM_Bjw20PtiV7MWIvBYw&vprv=1&svpuc=1&mime=video%2Fmp4&ns=cz8Nxunp1rHSguoo1wcrzEgQ&rqh=1&gir=yes&clen=90307538&dur=363.096&lmt=1715997843891502&mt=1744707009&fvip=5&keepalive=yes&lmw=1&c=TVHTML5&sefc=1&txp=8219224&n=PBPq18nL3N1ffg&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgHjOhp359MGghHl5hD7-RoKLQlKeOFM4Q4g000vgWpxcCIHnOxkQtrQDA53aR7EVcdRENKUWaryWKpBh1ErwVQcRE&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms&lsig=ACuhMU0wRQIgZ0XmiLxruqBgYHRknVlIBAm4hxdyoGHOhMMNLVAV8HgCIQCcDoVNTiG8GM4_cJaGHXdM95Lg2RGy2Dh6-bHGlHQa2w%3D%3D: Server returned 400 Bad Request
ERROR: ffmpeg exited with code 1
File "/fsx_home/homes/srdecny/meaning3/env/bin/yt-dlp", line 8, in <module>
sys.exit(main())
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/__init__.py", line 1100, in main
_exit(*variadic(_real_main(argv)))
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/__init__.py", line 1091, in _real_main
return ydl.download(all_urls)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3634, in download
self.__download_wrapper(self.extract_info)(
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3607, in wrapper
res = func(*args, **kwargs)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1642, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1653, in wrapper
return func(self, *args, **kwargs)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1809, in __extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1868, in process_ie_result
ie_result = self.process_video_result(ie_result, download=download)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3040, in process_video_result
self.process_info(new_info)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 185, in wrapper
return func(self, *args, **kwargs)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3455, in process_info
success, real_download = self.dl(temp_filename, info_dict)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3228, in dl
return fd.download(name, new_info, subtitle)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/downloader/common.py", line 468, in download
ret = self.real_download(filename, info_dict)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/downloader/external.py", line 79, in real_download
self.report_error('%s exited with code %d' % (
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1111, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1039, in trouble
tb_data = traceback.format_list(traceback.extract_stack())
When not using the proxy, it works OK and the partial video is downloaded without any issues. This points to an issue with ffmpeg and the proxy.
Using sudo strace -f -s 10000 -e trace=sendto bash yt.sh
where yt.sh
contains the command above, I get the following:
(...)
[tcp @ 0x56815295c140] Starting connection attempt to 129.153.143.113 port 8011
[tcp @ 0x56815295c140] Successfully connected to 129.153.143.113 port 8011
[pid 2393762] sendto(3, "CONNECT rr5---sn-q4fl6n6d.googlevideo.com:443 HTTP/1.1\r\nHost: api.zyte.com:8011\r\nConnection: close\r\n\r\n", 102, MSG_NOSIGNAL, NULL, 0) = 102
[httpproxy @ 0x568152959580] HTTP error 400 Bad request
https://rr5---sn-q4fl6n6d.googlevideo.com/videoplayback?expire=1744729434&ei=-SD-Z5bpO-ODy_sPluKc-QI&ip=84.46.234.88&id=o-AK8rPFZTTQmfrvcqBmldJR0LDUkYn8hMqyc1Uk1nqic6&itag=137&aitags=134%2C136%2C137%2C160%2C243&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1744707833%2C&mh=6D&mm=31%2C26&mn=sn-q4fl6n6d%2Csn-najern7r&ms=au%2Conr&mv=u&mvi=5&pl=24&rms=au%2Cau&bui=AccgBcME9nRgoGadqguDtMzp-J5Fg0tl9FrojUsi2n6hy2Ne3NwQ6vz66bcBBck99QS3a4OAQEICfJ4W&spc=_S3wKp0DKGundwkOqt7AP2SRwTKTED_9HYjE7wzP5LCSzhGWSUKQFmbH_Pg16WF2_s-FEg&vprv=1&svpuc=1&mime=video%2Fmp4&ns=4AAnIipqn2kzBeAVntPc_HIQ&rqh=1&gir=yes&clen=90307538&dur=363.096&lmt=1715997843891502&mt=1744707009&fvip=2&keepalive=yes&lmw=1&c=TVHTML5&sefc=1&txp=8219224&n=HgidVEz_ACOxAw&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRgIhAK38ZebhrjloXouz349sVywgvcXj2MLn2-ISqWY9JH0oAiEAjkaABcS3mbimUDirc70e7MoMagOrQgL8iffSR1iUFQA%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms&lsig=ACuhMU0wRgIhAK-T4z1JzxfVeVIVj1JFPeegMAcKiS64XbhHNTUZ-hadAiEA9f9LO3himp13kCbqeKJoTmTJ94Ch8GzL8jrSrqH-c-8%3D: Server returned 400 Bad Request
[pid 2393762] +++ exited with 1 +++
I believe the HTTP request sent by ffmpeg is wrong: CONNECT rr5---sn-q4fl6n6d.googlevideo.com:443 HTTP/1.1\r\nHost: api.zyte.com:8011\r\nConnection: close\r\n\r\n",
. Looking at the MDSN docs, the Host
should not be api.zyte.com
, but should match the YT's CDN server: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/CONNECT. It is also missing the Proxy-Authorization
header.
I am not sure if this is an issue with ffmpeg itself, or with yt-dlp passing wrong stuff to ffmpeg. I have tried using yt-dlp's prebuilt binaries, but it also has the same error. I also tried setting HTTP_PROXY
env var and/or passing --downloader-args ffmpeg:"-http_proxy http://REDACTED:@api.zyte.com:8011
but that also doesn't work.
I also tried manually connecting to my proxy server with nc
and passing the correct CONNECT
headers to it, and that works. So the proxy server supports the CONNECT request, and the issue is indeed with ffmpeg using wrong headers.
Similar issues: #11895 (but this one deals with 403, not 400)
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
toYoutubeDL
params instead - Copy the WHOLE output (starting with
[debug] Command-line config
) and insert it below
Complete Verbose Output
[debug] Command-line config: ['--proxy', 'http://xxx:@api.zyte.com:8011', '--no-check-certificate', '-vU', '--download-sections', '*30-31', 'https://www.youtube.com/watch?v=McVP8SZl-cw']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2025.04.06.232826 from yt-dlp/yt-dlp-nightly-builds [74e90dd9b] (pip)
[debug] Python 3.11.8 (CPython x86_64 64bit) - Linux-6.5.0-1024-aws-x86_64-with-glibc2.35 (OpenSSL 3.0.2 15 Mar 2022, glibc 2.35)
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2023.07.22, mutagen-1.47.0, requests-2.32.3, sqlite3-3.37.2, urllib3-2.0.7, websockets-15.0
[debug] Proxy map: {'all': 'http://xxx:@api.zyte.com:8011'}
[debug] Request Handlers: urllib, requests, websockets
[debug] Plugin directories: none
[debug] Loaded 1856 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2025.04.06.232826 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2025.04.06.232826 from yt-dlp/yt-dlp-nightly-builds)
[youtube] Extracting URL: https://www.youtube.com/watch?v=McVP8SZl-cw
[youtube] McVP8SZl-cw: Downloading webpage
[youtube] McVP8SZl-cw: Downloading tv client config
[youtube] McVP8SZl-cw: Downloading tv player API JSON
[youtube] McVP8SZl-cw: Downloading ios player API JSON
[debug] Loading youtube-nsig.64be519f-main from cache
[debug] [youtube] Decrypted nsig H2bPSeW1QCbkbnNxF => OfkCvNs_RL5M1g
[debug] [youtube] Decrypted nsig aL91cMKNi0V4eXJ5I => PBPq18nL3N1ffg
[debug] [youtube] McVP8SZl-cw: ios client https formats require a GVS PO Token which was not provided. They will be skipped as they may yield HTTP Error 403. You can manually pass a GVS PO Token for this client with --extractor-args "youtube:po_token=ios.gvs+XXX". For more information, refer to https://github.com/yt-dlp/yt-dlp/wiki/PO-Token-Guide . To enable these broken formats anyway, pass --extractor-args "youtube:formats=missing_pot"
[youtube] McVP8SZl-cw: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec, channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] McVP8SZl-cw: Downloading 1 format(s): 137+251
[info] McVP8SZl-cw: Downloading 1 time ranges: 30.0-31.0
[debug] Invoking ffmpeg downloader on "https://rr2---sn-najern7r.googlevideo.com/videoplayback?expire=1744729165&ei=7R_-Z7TnLK6Y2_gPhLjv6Ag&ip=181.215.217.101&id=o-AAk4v2i8e5qnMb2OuwR7E_23ZvMxIp4M8okSBbKLRkiR&itag=137&aitags=134%2C136%2C137%2C160%2C243&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1744707565%2C&mh=6D&mm=31%2C26&mn=sn-najern7r%2Csn-a5mlrnek&ms=au%2Conr&mv=u&mvi=2&pl=24&rms=au%2Cau&bui=AccgBcMP_BImni1c8rETIQSuUs2AVTcCvjtMsazCLOUHS_5xWR_k2SxlUGqN6_kj7YKCfzD-vgwXU32r&spc=_S3wKs6BUfvwlPJ0fS7dfAx4jVX0KaChfxnPN14_uufp5k8KZ9jM_Bjw20PtiV7MWIvBYw&vprv=1&svpuc=1&mime=video%2Fmp4&ns=cz8Nxunp1rHSguoo1wcrzEgQ&rqh=1&gir=yes&clen=90307538&dur=363.096&lmt=1715997843891502&mt=1744707009&fvip=5&keepalive=yes&lmw=1&c=TVHTML5&sefc=1&txp=8219224&n=PBPq18nL3N1ffg&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgHjOhp359MGghHl5hD7-RoKLQlKeOFM4Q4g000vgWpxcCIHnOxkQtrQDA53aR7EVcdRENKUWaryWKpBh1ErwVQcRE&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms&lsig=ACuhMU0wRQIgZ0XmiLxruqBgYHRknVlIBAm4hxdyoGHOhMMNLVAV8HgCIQCcDoVNTiG8GM4_cJaGHXdM95Lg2RGy2Dh6-bHGlHQa2w%3D%3D", "https://rr2---sn-najern7r.googlevideo.com/videoplayback?expire=1744729165&ei=7R_-Z7TnLK6Y2_gPhLjv6Ag&ip=181.215.217.101&id=o-AAk4v2i8e5qnMb2OuwR7E_23ZvMxIp4M8okSBbKLRkiR&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1744707565%2C&mh=6D&mm=31%2C26&mn=sn-najern7r%2Csn-a5mlrnek&ms=au%2Conr&mv=u&mvi=2&pl=24&rms=au%2Cau&bui=AccgBcMP_BImni1c8rETIQSuUs2AVTcCvjtMsazCLOUHS_5xWR_k2SxlUGqN6_kj7YKCfzD-vgwXU32r&spc=_S3wKs6BUfvwlPJ0fS7dfAx4jVX0KaChfxnPN14_uufp5k8KZ9jM_Bjw20PtiV7MWIvBYw&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=cz8Nxunp1rHSguoo1wcrzEgQ&rqh=1&gir=yes&clen=6001835&dur=363.141&lmt=1715997785896416&mt=1744707009&fvip=5&keepalive=yes&lmw=1&c=TVHTML5&sefc=1&txp=8218224&n=PBPq18nL3N1ffg&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgcDcVFt_nkDK4gsRkCYyWny34v_MfbNPHqKteyOnqmzYCIA-_EWSeiDSLF_fYydqidKqUsvJVezhMsSRAlp4su80r&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms&lsig=ACuhMU0wRQIgZ0XmiLxruqBgYHRknVlIBAm4hxdyoGHOhMMNLVAV8HgCIQCcDoVNTiG8GM4_cJaGHXdM95Lg2RGy2Dh6-bHGlHQa2w%3D%3D"
[download] Destination: Proven Benefits Of Ashwaganda [McVP8SZl-cw].mkv
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Sec-Fetch-Mode: navigate
' -ss 30.0 -t 1.0 -i 'https://rr2---sn-najern7r.googlevideo.com/videoplayback?expire=1744729165&ei=7R_-Z7TnLK6Y2_gPhLjv6Ag&ip=181.215.217.101&id=o-AAk4v2i8e5qnMb2OuwR7E_23ZvMxIp4M8okSBbKLRkiR&itag=137&aitags=134%2C136%2C137%2C160%2C243&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1744707565%2C&mh=6D&mm=31%2C26&mn=sn-najern7r%2Csn-a5mlrnek&ms=au%2Conr&mv=u&mvi=2&pl=24&rms=au%2Cau&bui=AccgBcMP_BImni1c8rETIQSuUs2AVTcCvjtMsazCLOUHS_5xWR_k2SxlUGqN6_kj7YKCfzD-vgwXU32r&spc=_S3wKs6BUfvwlPJ0fS7dfAx4jVX0KaChfxnPN14_uufp5k8KZ9jM_Bjw20PtiV7MWIvBYw&vprv=1&svpuc=1&mime=video%2Fmp4&ns=cz8Nxunp1rHSguoo1wcrzEgQ&rqh=1&gir=yes&clen=90307538&dur=363.096&lmt=1715997843891502&mt=1744707009&fvip=5&keepalive=yes&lmw=1&c=TVHTML5&sefc=1&txp=8219224&n=PBPq18nL3N1ffg&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgHjOhp359MGghHl5hD7-RoKLQlKeOFM4Q4g000vgWpxcCIHnOxkQtrQDA53aR7EVcdRENKUWaryWKpBh1ErwVQcRE&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms&lsig=ACuhMU0wRQIgZ0XmiLxruqBgYHRknVlIBAm4hxdyoGHOhMMNLVAV8HgCIQCcDoVNTiG8GM4_cJaGHXdM95Lg2RGy2Dh6-bHGlHQa2w%3D%3D' -headers 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Sec-Fetch-Mode: navigate
' -ss 30.0 -t 1.0 -i 'https://rr2---sn-najern7r.googlevideo.com/videoplayback?expire=1744729165&ei=7R_-Z7TnLK6Y2_gPhLjv6Ag&ip=181.215.217.101&id=o-AAk4v2i8e5qnMb2OuwR7E_23ZvMxIp4M8okSBbKLRkiR&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1744707565%2C&mh=6D&mm=31%2C26&mn=sn-najern7r%2Csn-a5mlrnek&ms=au%2Conr&mv=u&mvi=2&pl=24&rms=au%2Cau&bui=AccgBcMP_BImni1c8rETIQSuUs2AVTcCvjtMsazCLOUHS_5xWR_k2SxlUGqN6_kj7YKCfzD-vgwXU32r&spc=_S3wKs6BUfvwlPJ0fS7dfAx4jVX0KaChfxnPN14_uufp5k8KZ9jM_Bjw20PtiV7MWIvBYw&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=cz8Nxunp1rHSguoo1wcrzEgQ&rqh=1&gir=yes&clen=6001835&dur=363.141&lmt=1715997785896416&mt=1744707009&fvip=5&keepalive=yes&lmw=1&c=TVHTML5&sefc=1&txp=8218224&n=PBPq18nL3N1ffg&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgcDcVFt_nkDK4gsRkCYyWny34v_MfbNPHqKteyOnqmzYCIA-_EWSeiDSLF_fYydqidKqUsvJVezhMsSRAlp4su80r&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms&lsig=ACuhMU0wRQIgZ0XmiLxruqBgYHRknVlIBAm4hxdyoGHOhMMNLVAV8HgCIQCcDoVNTiG8GM4_cJaGHXdM95Lg2RGy2Dh6-bHGlHQa2w%3D%3D' -c copy -map 0:0 -map 1:0 -f matroska 'file:Proven Benefits Of Ashwaganda [McVP8SZl-cw].mkv.part'
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
[tcp @ 0x5c60047cb140] Starting connection attempt to 129.153.143.113 port 8011
[tcp @ 0x5c60047cb140] Successfully connected to 129.153.143.113 port 8011
[httpproxy @ 0x5c60047c8580] HTTP error 400 Bad request
https://rr2---sn-najern7r.googlevideo.com/videoplayback?expire=1744729165&ei=7R_-Z7TnLK6Y2_gPhLjv6Ag&ip=181.215.217.101&id=o-AAk4v2i8e5qnMb2OuwR7E_23ZvMxIp4M8okSBbKLRkiR&itag=137&aitags=134%2C136%2C137%2C160%2C243&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1744707565%2C&mh=6D&mm=31%2C26&mn=sn-najern7r%2Csn-a5mlrnek&ms=au%2Conr&mv=u&mvi=2&pl=24&rms=au%2Cau&bui=AccgBcMP_BImni1c8rETIQSuUs2AVTcCvjtMsazCLOUHS_5xWR_k2SxlUGqN6_kj7YKCfzD-vgwXU32r&spc=_S3wKs6BUfvwlPJ0fS7dfAx4jVX0KaChfxnPN14_uufp5k8KZ9jM_Bjw20PtiV7MWIvBYw&vprv=1&svpuc=1&mime=video%2Fmp4&ns=cz8Nxunp1rHSguoo1wcrzEgQ&rqh=1&gir=yes&clen=90307538&dur=363.096&lmt=1715997843891502&mt=1744707009&fvip=5&keepalive=yes&lmw=1&c=TVHTML5&sefc=1&txp=8219224&n=PBPq18nL3N1ffg&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRAIgHjOhp359MGghHl5hD7-RoKLQlKeOFM4Q4g000vgWpxcCIHnOxkQtrQDA53aR7EVcdRENKUWaryWKpBh1ErwVQcRE&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Crms&lsig=ACuhMU0wRQIgZ0XmiLxruqBgYHRknVlIBAm4hxdyoGHOhMMNLVAV8HgCIQCcDoVNTiG8GM4_cJaGHXdM95Lg2RGy2Dh6-bHGlHQa2w%3D%3D: Server returned 400 Bad Request
ERROR: ffmpeg exited with code 1
File "/fsx_home/homes/srdecny/meaning3/env/bin/yt-dlp", line 8, in <module>
sys.exit(main())
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/__init__.py", line 1100, in main
_exit(*variadic(_real_main(argv)))
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/__init__.py", line 1091, in _real_main
return ydl.download(all_urls)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3634, in download
self.__download_wrapper(self.extract_info)(
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3607, in wrapper
res = func(*args, **kwargs)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1642, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1653, in wrapper
return func(self, *args, **kwargs)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1809, in __extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1868, in process_ie_result
ie_result = self.process_video_result(ie_result, download=download)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3040, in process_video_result
self.process_info(new_info)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 185, in wrapper
return func(self, *args, **kwargs)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3455, in process_info
success, real_download = self.dl(temp_filename, info_dict)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3228, in dl
return fd.download(name, new_info, subtitle)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/downloader/common.py", line 468, in download
ret = self.real_download(filename, info_dict)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/downloader/external.py", line 79, in real_download
self.report_error('%s exited with code %d' % (
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1111, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
File "/fsx_home/homes/srdecny/meaning3/env/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1039, in trouble
tb_data = traceback.format_list(traceback.extract_stack())