aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2023-07-21 21:32:49 -0500
committerGitHub <noreply@github.com>2023-07-22 02:32:49 +0000
commite57eb98222d29cc4c09ee975d3c492274a6e5be3 (patch)
tree153680a864b181c37df28a69907b50e0971b6d2f /yt_dlp
parent9b16762f48914de9ac914601769c76668e433325 (diff)
downloadhypervideo-pre-e57eb98222d29cc4c09ee975d3c492274a6e5be3.tar.lz
hypervideo-pre-e57eb98222d29cc4c09ee975d3c492274a6e5be3.tar.xz
hypervideo-pre-e57eb98222d29cc4c09ee975d3c492274a6e5be3.zip
[fd/external] Fix ffmpeg input from stdin (#7655)
Bugfix for 1ceb657bdd254ad961489e5060f2ccc7d556b729 Authored by: bashonly
Diffstat (limited to 'yt_dlp')
-rw-r--r--yt_dlp/downloader/external.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/yt_dlp/downloader/external.py b/yt_dlp/downloader/external.py
index 4f52f6e8d..d3c3eba88 100644
--- a/yt_dlp/downloader/external.py
+++ b/yt_dlp/downloader/external.py
@@ -559,12 +559,13 @@ class FFmpegFD(ExternalFD):
selected_formats = info_dict.get('requested_formats') or [info_dict]
for i, fmt in enumerate(selected_formats):
- cookies = self.ydl.cookiejar.get_cookies_for_url(fmt['url'])
+ is_http = re.match(r'^https?://', fmt['url'])
+ cookies = self.ydl.cookiejar.get_cookies_for_url(fmt['url']) if is_http else []
if cookies:
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 re.match(r'^https?://', fmt['url']):
+ if fmt.get('http_headers') and is_http:
# Trailing \r\n after each HTTP header is important to prevent warning from ffmpeg/avconv:
# [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())])