Load archive only after printing verbose head
If there is some issue in loading archive, the verbose head should be visible in the logs
This commit is contained in:
parent
a169858f24
commit
ed39cac53d
1 changed files with 18 additions and 18 deletions
|
@ -601,24 +601,6 @@ class YoutubeDL(object):
|
||||||
|
|
||||||
self._setup_opener()
|
self._setup_opener()
|
||||||
|
|
||||||
def preload_download_archive(fn):
|
|
||||||
"""Preload the archive, if any is specified"""
|
|
||||||
if fn is None:
|
|
||||||
return False
|
|
||||||
self.write_debug('Loading archive file %r\n' % fn)
|
|
||||||
try:
|
|
||||||
with locked_file(fn, 'r', encoding='utf-8') as archive_file:
|
|
||||||
for line in archive_file:
|
|
||||||
self.archive.add(line.strip())
|
|
||||||
except IOError as ioe:
|
|
||||||
if ioe.errno != errno.ENOENT:
|
|
||||||
raise
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
self.archive = set()
|
|
||||||
preload_download_archive(self.params.get('download_archive'))
|
|
||||||
|
|
||||||
if auto_init:
|
if auto_init:
|
||||||
self.print_debug_header()
|
self.print_debug_header()
|
||||||
self.add_default_info_extractors()
|
self.add_default_info_extractors()
|
||||||
|
@ -638,6 +620,24 @@ class YoutubeDL(object):
|
||||||
|
|
||||||
register_socks_protocols()
|
register_socks_protocols()
|
||||||
|
|
||||||
|
def preload_download_archive(fn):
|
||||||
|
"""Preload the archive, if any is specified"""
|
||||||
|
if fn is None:
|
||||||
|
return False
|
||||||
|
self.write_debug('Loading archive file %r\n' % fn)
|
||||||
|
try:
|
||||||
|
with locked_file(fn, 'r', encoding='utf-8') as archive_file:
|
||||||
|
for line in archive_file:
|
||||||
|
self.archive.add(line.strip())
|
||||||
|
except IOError as ioe:
|
||||||
|
if ioe.errno != errno.ENOENT:
|
||||||
|
raise
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
self.archive = set()
|
||||||
|
preload_download_archive(self.params.get('download_archive'))
|
||||||
|
|
||||||
def warn_if_short_id(self, argv):
|
def warn_if_short_id(self, argv):
|
||||||
# short YouTube ID starting with dash?
|
# short YouTube ID starting with dash?
|
||||||
idxs = [
|
idxs = [
|
||||||
|
|
Loading…
Reference in a new issue