From a6791415e04aaf4bb4c105991ceb3ca6b24afc18 Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Tue, 9 Jun 2026 17:05:24 -0500 Subject: [PATCH] [fd/ffmpeg] Use info dict `http_headers` for direct merge downloads (#15456) Addresses https://github.com/yt-dlp/yt-dlp/pull/13210#discussion_r2655976236 Authored by: bashonly --- yt_dlp/downloader/external.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yt_dlp/downloader/external.py b/yt_dlp/downloader/external.py index 14879b358d..79c10485c6 100644 --- a/yt_dlp/downloader/external.py +++ b/yt_dlp/downloader/external.py @@ -521,10 +521,11 @@ class FFmpegFD(ExternalFD): args.extend(['-cookies', ''.join( f'{cookie.name}={cookie.value}; path={cookie.path}; domain={cookie.domain};\r\n' for cookie in cookies)]) - if fmt.get('http_headers') and is_http: + http_headers = fmt.get('http_headers') or info_dict.get('http_headers') + if http_headers and is_http: # Trailing \r\n after each HTTP header is important to prevent warning from ffmpeg: # [http @ 00000000003d2fa0] No trailing CRLF found in HTTP header. - args.extend(['-headers', ''.join(f'{key}: {val}\r\n' for key, val in fmt['http_headers'].items())]) + args.extend(['-headers', ''.join(f'{key}: {val}\r\n' for key, val in http_headers.items())]) if start_time: args += ['-ss', str(start_time)]