mirror of
https://github.com/l1ving/youtube-dl
synced 2025-01-23 10:32:54 +08:00
Bind break_on_existing, improve its logic
This commit is contained in:
parent
fdceeb43ce
commit
674e7d46db
@ -995,13 +995,13 @@ class YoutubeDL(object):
|
|||||||
}
|
}
|
||||||
|
|
||||||
reason = self._match_entry(entry, incomplete=True)
|
reason = self._match_entry(entry, incomplete=True)
|
||||||
if reason.endswith('has already been recorded in archive') and self.params.get('break_on_existing'):
|
if reason is not None:
|
||||||
self.to_screen('[download] stopping downloading because ' + reason)
|
if reason.endswith('has already been recorded in the archive') and self.params.get('break_on_existing'):
|
||||||
break
|
print('[download] tried downloading a file that\'s already in the archive, stopping since --break-on-existing is set.')
|
||||||
|
break
|
||||||
elif reason is not None:
|
else:
|
||||||
self.to_screen('[download] ' + reason)
|
self.to_screen('[download] ' + reason)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
entry_result = self.process_ie_result(entry,
|
entry_result = self.process_ie_result(entry,
|
||||||
download=download,
|
download=download,
|
||||||
|
@ -393,6 +393,7 @@ def _real_main(argv=None):
|
|||||||
'youtube_print_sig_code': opts.youtube_print_sig_code,
|
'youtube_print_sig_code': opts.youtube_print_sig_code,
|
||||||
'age_limit': opts.age_limit,
|
'age_limit': opts.age_limit,
|
||||||
'download_archive': download_archive_fn,
|
'download_archive': download_archive_fn,
|
||||||
|
'break_on_existing': opts.break_on_existing,
|
||||||
'cookiefile': opts.cookiefile,
|
'cookiefile': opts.cookiefile,
|
||||||
'nocheckcertificate': opts.no_check_certificate,
|
'nocheckcertificate': opts.no_check_certificate,
|
||||||
'prefer_insecure': opts.prefer_insecure,
|
'prefer_insecure': opts.prefer_insecure,
|
||||||
|
Loading…
Reference in New Issue
Block a user