aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-01-03 23:45:56 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-01-03 23:52:56 +0530
commitb62fa6d75f56940009ebe4bf6bbff605735ab995 (patch)
tree5fd47feb87e06deb1237fea7248b6030ae166d68
parentbe72c62480031380809e9f940145a7d2cd26e3cd (diff)
downloadhypervideo-pre-b62fa6d75f56940009ebe4bf6bbff605735ab995.tar.lz
hypervideo-pre-b62fa6d75f56940009ebe4bf6bbff605735ab995.tar.xz
hypervideo-pre-b62fa6d75f56940009ebe4bf6bbff605735ab995.zip
Fix `-s --ignore-no-formats --force-write-archive`
Bug in a13e684813dccc21f3d71711bf79dafbe943bccb
-rw-r--r--yt_dlp/YoutubeDL.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 993d061cf..1b787e538 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -2552,20 +2552,20 @@ class YoutubeDL(object):
continue
break
- best_format = formats_to_download[-1] if formats_to_download else {}
if not formats_to_download:
if not self.params.get('ignore_no_formats_error'):
raise ExtractorError('Requested format is not available', expected=True,
video_id=info_dict['id'], ie=info_dict['extractor'])
- else:
- self.report_warning('Requested format is not available')
- # Process what we can, even without any available formats.
- self.process_info(dict(info_dict))
- elif download:
- self.to_screen(
- f'[info] {info_dict["id"]}: Downloading {len(formats_to_download)} format(s): '
- + ', '.join([f['format_id'] for f in formats_to_download]))
+ self.report_warning('Requested format is not available')
+ # Process what we can, even without any available formats.
+ formats_to_download = [{}]
+ best_format = formats_to_download[-1]
+ if download:
+ if best_format:
+ self.to_screen(
+ f'[info] {info_dict["id"]}: Downloading {len(formats_to_download)} format(s): '
+ + ', '.join([f['format_id'] for f in formats_to_download]))
max_downloads_reached = False
for i, fmt in enumerate(formats_to_download):
formats_to_download[i] = new_info = dict(info_dict)