mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-27 16:56:30 +02:00
[cookies] Support Firefox containers JSON version 5
This commit is contained in:
parent
168e72dcd3
commit
624451ffae
@ -146,7 +146,8 @@ def _extract_firefox_cookies(profile, container, logger):
|
||||
identities = json.load(containers).get('identities', [])
|
||||
container_id = next((context.get('userContextId') for context in identities if container in (
|
||||
context.get('name'),
|
||||
try_call(lambda: re.fullmatch(r'userContext([^\.]+)\.label', context['l10nID']).group())
|
||||
try_call(lambda: re.fullmatch(r'userContext([^\.]+)\.label', context['l10nID']).group()),
|
||||
try_call(lambda: re.fullmatch(r'user-context-(.+)', context['l10nId']).group())
|
||||
)), None)
|
||||
if not isinstance(container_id, int):
|
||||
raise ValueError(f'could not find firefox container "{container}" in containers.json')
|
||||
|
Loading…
Reference in New Issue
Block a user