Fix concurrent formats downloading to stdout (#15617)
Some checks failed
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.11) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.12) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.13) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, 3.14) (push) Has been cancelled
Core Tests / Core Tests (ubuntu-latest, pypy-3.11) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.10) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.11) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.12) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.13) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.14) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, pypy-3.11) (push) Has been cancelled
Quick Test / Core Test (push) Has been cancelled
Quick Test / Code check (push) Has been cancelled
Release (master) / Publish Github release (push) Has been cancelled
Release (master) / Publish to PyPI (push) Has been cancelled
Release (nightly) / Check for new commits (push) Has been cancelled
Release (nightly) / Publish Github release (push) Has been cancelled
Release (nightly) / Publish to PyPI (push) Has been cancelled

Authored by: grqz
This commit is contained in:
N/Ame
2026-01-28 16:57:09 +13:00
committed by GitHub
parent 1829a53a54
commit 5bf91072bc

View File

@@ -3481,11 +3481,12 @@ class YoutubeDL:
if dl_filename is not None:
self.report_file_already_downloaded(dl_filename)
elif fd:
for f in info_dict['requested_formats'] if fd != FFmpegFD else []:
f['filepath'] = fname = prepend_extension(
correct_ext(temp_filename, info_dict['ext']),
'f{}'.format(f['format_id']), info_dict['ext'])
downloaded.append(fname)
if fd != FFmpegFD and temp_filename != '-':
for f in info_dict['requested_formats']:
f['filepath'] = fname = prepend_extension(
correct_ext(temp_filename, info_dict['ext']),
'f{}'.format(f['format_id']), info_dict['ext'])
downloaded.append(fname)
info_dict['url'] = '\n'.join(f['url'] for f in info_dict['requested_formats'])
success, real_download = self.dl(temp_filename, info_dict)
info_dict['__real_download'] = real_download