support selecting a domain for '--cookies-from-browser'

for example 'gallery-dl --cookies-from-browser firefox/twitter.com'
This commit is contained in:
Mike Fährmann
2023-05-05 21:32:18 +02:00
parent 3ca5dac8b6
commit a14b63d941
5 changed files with 61 additions and 27 deletions

View File

@@ -70,12 +70,14 @@ def main():
if args.cookies_from_browser:
browser, _, profile = args.cookies_from_browser.partition(":")
browser, _, keyring = browser.partition("+")
browser, _, domain = browser.partition("/")
if profile.startswith(":"):
container = profile[1:]
profile = None
else:
profile, _, container = profile.partition("::")
config.set((), "cookies", (browser, profile, keyring, container))
config.set((), "cookies", (
browser, profile, keyring, container, domain))
if args.options_pp:
config.set((), "postprocessor-options", args.options_pp)
for opts in args.options: