mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	Add option --alias
				
					
				
			This commit is contained in:
		| @@ -5153,11 +5153,12 @@ def parse_http_range(range): | ||||
| 
 | ||||
| class Config: | ||||
|     own_args = None | ||||
|     parsed_args = None | ||||
|     filename = None | ||||
|     __initialized = False | ||||
| 
 | ||||
|     def __init__(self, parser, label=None): | ||||
|         self._parser, self.label = parser, label | ||||
|         self.parser, self.label = parser, label | ||||
|         self._loaded_paths, self.configs = set(), [] | ||||
| 
 | ||||
|     def init(self, args=None, filename=None): | ||||
| @@ -5170,14 +5171,16 @@ class Config: | ||||
|                 return False | ||||
|             self._loaded_paths.add(location) | ||||
| 
 | ||||
|         self.__initialized = True | ||||
|         self.own_args, self.filename = args, filename | ||||
|         for location in self._parser.parse_args(args)[0].config_locations or []: | ||||
|         self.own_args, self.__initialized = args, True | ||||
|         opts, _ = self.parser.parse_known_args(args) | ||||
|         self.parsed_args, self.filename = args, filename | ||||
| 
 | ||||
|         for location in opts.config_locations or []: | ||||
|             location = os.path.join(directory, expand_path(location)) | ||||
|             if os.path.isdir(location): | ||||
|                 location = os.path.join(location, 'yt-dlp.conf') | ||||
|             if not os.path.exists(location): | ||||
|                 self._parser.error(f'config location {location} does not exist') | ||||
|                 self.parser.error(f'config location {location} does not exist') | ||||
|             self.append_config(self.read_file(location), location) | ||||
|         return True | ||||
| 
 | ||||
| @@ -5223,7 +5226,7 @@ class Config: | ||||
|         return opts | ||||
| 
 | ||||
|     def append_config(self, *args, label=None): | ||||
|         config = type(self)(self._parser, label) | ||||
|         config = type(self)(self.parser, label) | ||||
|         config._loaded_paths = self._loaded_paths | ||||
|         if config.init(*args): | ||||
|             self.configs.append(config) | ||||
| @@ -5232,10 +5235,13 @@ class Config: | ||||
|     def all_args(self): | ||||
|         for config in reversed(self.configs): | ||||
|             yield from config.all_args | ||||
|         yield from self.own_args or [] | ||||
|         yield from self.parsed_args or [] | ||||
| 
 | ||||
|     def parse_known_args(self, **kwargs): | ||||
|         return self.parser.parse_known_args(self.all_args, **kwargs) | ||||
| 
 | ||||
|     def parse_args(self): | ||||
|         return self._parser.parse_args(self.all_args) | ||||
|         return self.parser.parse_args(self.all_args) | ||||
| 
 | ||||
| 
 | ||||
| class WebSocketsWrapper(): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 pukkandan
					pukkandan