summaryrefslogtreecommitdiffstats
path: root/gallery_dl/ytdl.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2024-08-03 20:27:44 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2024-08-03 20:27:44 -0400
commit032e5bed275a253e122ed9ac86dac7b8c4204172 (patch)
treeb4eda52ebfe00c4d22e9d633b1ab2d158a9f0573 /gallery_dl/ytdl.py
parent80e39a8fc7de105510cbbdca8507f2a4b8c9e01d (diff)
New upstream version 1.27.2.upstream/1.27.2
Diffstat (limited to 'gallery_dl/ytdl.py')
-rw-r--r--gallery_dl/ytdl.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/gallery_dl/ytdl.py b/gallery_dl/ytdl.py
index 0a0bf86..d4fdedc 100644
--- a/gallery_dl/ytdl.py
+++ b/gallery_dl/ytdl.py
@@ -249,6 +249,22 @@ def parse_command_line(module, argv):
None if opts.match_filter is None
else module.match_filter_func(opts.match_filter))
+ cookiesfrombrowser = getattr(opts, "cookiesfrombrowser", None)
+ if cookiesfrombrowser:
+ match = re.fullmatch(r"""(?x)
+ (?P<name>[^+:]+)
+ (?:\s*\+\s*(?P<keyring>[^:]+))?
+ (?:\s*:\s*(?!:)(?P<profile>.+?))?
+ (?:\s*::\s*(?P<container>.+))?
+ """, cookiesfrombrowser)
+ if match:
+ browser, keyring, profile, container = match.groups()
+ if keyring is not None:
+ keyring = keyring.upper()
+ cookiesfrombrowser = (browser.lower(), profile, keyring, container)
+ else:
+ cookiesfrombrowser = None
+
return {
"usenetrc": opts.usenetrc,
"netrc_location": getattr(opts, "netrc_location", None),
@@ -364,7 +380,7 @@ def parse_command_line(module, argv):
"skip_playlist_after_errors": getattr(
opts, "skip_playlist_after_errors", None),
"cookiefile": opts.cookiefile,
- "cookiesfrombrowser": getattr(opts, "cookiesfrombrowser", None),
+ "cookiesfrombrowser": cookiesfrombrowser,
"nocheckcertificate": opts.no_check_certificate,
"prefer_insecure": opts.prefer_insecure,
"proxy": opts.proxy,