1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-23 07:22:50 +08:00

Bind break_on_existing, improve its logic

This commit is contained in:
Yoav Shai 2018-10-26 02:31:52 +03:00
parent fdceeb43ce
commit 674e7d46db
2 changed files with 8 additions and 7 deletions

View File

@ -995,11 +995,11 @@ class YoutubeDL(object):
}
reason = self._match_entry(entry, incomplete=True)
if reason.endswith('has already been recorded in archive') and self.params.get('break_on_existing'):
self.to_screen('[download] stopping downloading because ' + reason)
if reason is not None:
if reason.endswith('has already been recorded in the archive') and self.params.get('break_on_existing'):
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)
continue

View File

@ -393,6 +393,7 @@ def _real_main(argv=None):
'youtube_print_sig_code': opts.youtube_print_sig_code,
'age_limit': opts.age_limit,
'download_archive': download_archive_fn,
'break_on_existing': opts.break_on_existing,
'cookiefile': opts.cookiefile,
'nocheckcertificate': opts.no_check_certificate,
'prefer_insecure': opts.prefer_insecure,