mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-30 22:25:19 +00:00 
			
		
		
		
	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:
		| @@ -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 = [ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 pukkandan
					pukkandan