mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-04 12:43:11 +08:00
Make sure process_info completes successfully
Makes sure that the checks and operations in process_info are completed successfully before adding video to download archive
This commit is contained in:
parent
d7ff06a0f3
commit
b6dd380f24
@ -1330,10 +1330,14 @@ class YoutubeDL(object):
|
||||
if download:
|
||||
if len(formats_to_download) > 1:
|
||||
self.to_screen('[info] %s: downloading video in %s formats' % (info_dict['id'], len(formats_to_download)))
|
||||
download_success = 0
|
||||
for format in formats_to_download:
|
||||
new_info = dict(info_dict)
|
||||
new_info.update(format)
|
||||
self.process_info(new_info)
|
||||
success = self.process_info(new_info)
|
||||
if success:
|
||||
download_success += 1
|
||||
if download_success == len(formats_to_download):
|
||||
self.record_download_archive(info_dict)
|
||||
# We update the info dict with the best quality format (backwards compatibility)
|
||||
info_dict.update(formats_to_download[-1])
|
||||
@ -1651,6 +1655,8 @@ class YoutubeDL(object):
|
||||
self.report_error('postprocessing: %s' % str(err))
|
||||
return
|
||||
|
||||
return success
|
||||
|
||||
def download(self, url_list):
|
||||
"""Download a given list of URLs."""
|
||||
outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL)
|
||||
|
Loading…
Reference in New Issue
Block a user