未验证 提交 ca46b941 编写于 作者: P pukkandan

[cookies] Make browser names case insensitive

上级 67ad7759
...@@ -248,7 +248,7 @@ def parse_retries(retries, name=''): ...@@ -248,7 +248,7 @@ def parse_retries(retries, name=''):
if opts.cookiesfrombrowser is not None: if opts.cookiesfrombrowser is not None:
opts.cookiesfrombrowser = [ opts.cookiesfrombrowser = [
part.strip() or None for part in opts.cookiesfrombrowser.split(':', 1)] 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') parser.error('unsupported browser specified for cookies')
if opts.date is not None: if opts.date is not None:
......
...@@ -748,6 +748,7 @@ def _is_path(value): ...@@ -748,6 +748,7 @@ def _is_path(value):
def _parse_browser_specification(browser_name, profile=None): def _parse_browser_specification(browser_name, profile=None):
browser_name = browser_name.lower()
if browser_name not in SUPPORTED_BROWSERS: if browser_name not in SUPPORTED_BROWSERS:
raise ValueError(f'unsupported browser: "{browser_name}"') raise ValueError(f'unsupported browser: "{browser_name}"')
if profile is not None and _is_path(profile): if profile is not None and _is_path(profile):
......
...@@ -1128,7 +1128,7 @@ def _dict_from_options_callback( ...@@ -1128,7 +1128,7 @@ def _dict_from_options_callback(
'You can specify the user profile name or directory using ' 'You can specify the user profile name or directory using '
'"BROWSER:PROFILE_NAME" or "BROWSER:PROFILE_PATH". ' '"BROWSER:PROFILE_NAME" or "BROWSER:PROFILE_PATH". '
'If no profile is given, the most recently accessed one is used'.format( 'If no profile is given, the most recently accessed one is used'.format(
'|'.join(sorted(SUPPORTED_BROWSERS))))) ', '.join(sorted(SUPPORTED_BROWSERS)))))
filesystem.add_option( filesystem.add_option(
'--no-cookies-from-browser', '--no-cookies-from-browser',
action='store_const', const=None, dest='cookiesfrombrowser', action='store_const', const=None, dest='cookiesfrombrowser',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册