From ca46b941349c0b5ab183320182fc61af28c70c45 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sat, 11 Sep 2021 17:49:03 +0530 Subject: [PATCH] [cookies] Make browser names case insensitive --- yt_dlp/__init__.py | 2 +- yt_dlp/cookies.py | 1 + yt_dlp/options.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py index ad2d5e035a..f9a7e2f111 100644 --- a/yt_dlp/__init__.py +++ b/yt_dlp/__init__.py @@ -248,7 +248,7 @@ def _real_main(argv=None): if opts.cookiesfrombrowser is not None: opts.cookiesfrombrowser = [ part.strip() or None for part in opts.cookiesfrombrowser.split(':', 1)] - if opts.cookiesfrombrowser[0] not in SUPPORTED_BROWSERS: + if opts.cookiesfrombrowser[0].lower() not in SUPPORTED_BROWSERS: parser.error('unsupported browser specified for cookies') if opts.date is not None: diff --git a/yt_dlp/cookies.py b/yt_dlp/cookies.py index bc3bb62f41..b5aff38ddc 100644 --- a/yt_dlp/cookies.py +++ b/yt_dlp/cookies.py @@ -748,6 +748,7 @@ def _is_path(value): def _parse_browser_specification(browser_name, profile=None): + browser_name = browser_name.lower() if browser_name not in SUPPORTED_BROWSERS: raise ValueError(f'unsupported browser: "{browser_name}"') if profile is not None and _is_path(profile): diff --git a/yt_dlp/options.py b/yt_dlp/options.py index c2d7a74ff7..7cabc35ae5 100644 --- a/yt_dlp/options.py +++ b/yt_dlp/options.py @@ -1128,7 +1128,7 @@ def parseOpts(overrideArguments=None): 'You can specify the user profile name or directory using ' '"BROWSER:PROFILE_NAME" or "BROWSER:PROFILE_PATH". ' 'If no profile is given, the most recently accessed one is used'.format( - '|'.join(sorted(SUPPORTED_BROWSERS))))) + ', '.join(sorted(SUPPORTED_BROWSERS))))) filesystem.add_option( '--no-cookies-from-browser', action='store_const', const=None, dest='cookiesfrombrowser',