mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[cookies] Support firefox container in --cookies-from-browser (#4753)
				
					
				
			Authored by: bashonly
This commit is contained in:
		| @@ -346,6 +346,7 @@ def validate_options(opts): | ||||
| 
 | ||||
|     # Cookies from browser | ||||
|     if opts.cookiesfrombrowser: | ||||
|         container = None | ||||
|         mobj = re.match(r'(?P<name>[^+:]+)(\s*\+\s*(?P<keyring>[^:]+))?(\s*:(?P<profile>.+))?', opts.cookiesfrombrowser) | ||||
|         if mobj is None: | ||||
|             raise ValueError(f'invalid cookies from browser arguments: {opts.cookiesfrombrowser}') | ||||
| @@ -354,12 +355,15 @@ def validate_options(opts): | ||||
|         if browser_name not in SUPPORTED_BROWSERS: | ||||
|             raise ValueError(f'unsupported browser specified for cookies: "{browser_name}". ' | ||||
|                              f'Supported browsers are: {", ".join(sorted(SUPPORTED_BROWSERS))}') | ||||
|         elif profile and browser_name == 'firefox': | ||||
|             if ':' in profile and not os.path.exists(profile): | ||||
|                 profile, container = profile.split(':', 1) | ||||
|         if keyring is not None: | ||||
|             keyring = keyring.upper() | ||||
|             if keyring not in SUPPORTED_KEYRINGS: | ||||
|                 raise ValueError(f'unsupported keyring specified for cookies: "{keyring}". ' | ||||
|                                  f'Supported keyrings are: {", ".join(sorted(SUPPORTED_KEYRINGS))}') | ||||
|         opts.cookiesfrombrowser = (browser_name, profile, keyring) | ||||
|         opts.cookiesfrombrowser = (browser_name, profile, keyring, container) | ||||
| 
 | ||||
|     # MetadataParser | ||||
|     def metadataparser_actions(f): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 bashonly
					bashonly