mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 09:01:43 +00:00
Stop immediately when reaching '--max-downloads' (https://github.com/ytdl-org/youtube-dl/pull/26638)
Authored by: glenn-slayden
This commit is contained in:
parent
8c04f0be96
commit
c3e6ffba53
@ -2220,6 +2220,9 @@ def compatible_formats(formats):
|
||||
|
||||
if must_record_download_archive or self.params.get('force_write_download_archive', False):
|
||||
self.record_download_archive(info_dict)
|
||||
max_downloads = self.params.get('max_downloads')
|
||||
if max_downloads is not None and self._num_downloads >= int(max_downloads):
|
||||
raise MaxDownloadsReached()
|
||||
|
||||
def download(self, url_list):
|
||||
"""Download a given list of URLs."""
|
||||
|
Loading…
Reference in New Issue
Block a user