[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
This commit is contained in:
bashonly 2026-06-09 17:05:24 -05:00 committed by GitHub
parent 98c0beab97
commit a6791415e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -521,10 +521,11 @@ class FFmpegFD(ExternalFD):
args.extend(['-cookies', ''.join( args.extend(['-cookies', ''.join(
f'{cookie.name}={cookie.value}; path={cookie.path}; domain={cookie.domain};\r\n' f'{cookie.name}={cookie.value}; path={cookie.path}; domain={cookie.domain};\r\n'
for cookie in cookies)]) 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: # Trailing \r\n after each HTTP header is important to prevent warning from ffmpeg:
# [http @ 00000000003d2fa0] No trailing CRLF found in HTTP header. # [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: if start_time:
args += ['-ss', str(start_time)] args += ['-ss', str(start_time)]