diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-10-11 04:00:52 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-10-11 09:49:52 +0530 |
commit | ed39cac53d0dcb51623918a9c8abdbe18b653459 (patch) | |
tree | 361817c7af22a3d3dd58e338a19525f446dbf253 /yt_dlp/YoutubeDL.py | |
parent | a169858f2409eefb66ac30085fddba81123f63b7 (diff) | |
download | hypervideo-pre-ed39cac53d0dcb51623918a9c8abdbe18b653459.tar.lz hypervideo-pre-ed39cac53d0dcb51623918a9c8abdbe18b653459.tar.xz hypervideo-pre-ed39cac53d0dcb51623918a9c8abdbe18b653459.zip |
Load archive only after printing verbose head
If there is some issue in loading archive, the verbose head should be visible in the logs
Diffstat (limited to 'yt_dlp/YoutubeDL.py')
-rw-r--r-- | yt_dlp/YoutubeDL.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 2730d2e19..59a3e3df1 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -601,24 +601,6 @@ class YoutubeDL(object): 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: self.print_debug_header() self.add_default_info_extractors() @@ -638,6 +620,24 @@ class YoutubeDL(object): 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): # short YouTube ID starting with dash? idxs = [ |