Skip to content

Commit

Permalink
使用缺省none来避免触发callback导致提权
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnserf-Seed committed Jan 4, 2024
1 parent c56d8f7 commit 88cb625
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions f2/apps/douyin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def handler_auto_cookie(
return

# 根据浏览器选择获取cookie (Get cookies based on browser selection)
if value not in ["chrome", "firefox", "edge", "opera"]:
if value in ["chrome", "firefox", "edge", "opera"]:
try:
cookie_value = split_dict_cookie(get_cookie_from_browser(value))
manager = ConfigManager(ctx.params.get("config", "conf/app.yaml"))
Expand Down Expand Up @@ -307,10 +307,10 @@ def handler_sso_login(
# @click.confirmation_option(prompt='是否要使用命令行的参数更新配置文件?')
@click.option(
"--auto-cookie",
type=click.Choice(["chrome", "firefox", "edge", "opera"]),
default="edge",
type=click.Choice(["none", "chrome", "firefox", "edge", "opera"]),
default="none",
help=_(
"自动从浏览器获取[yellow]cookie[/yellow]。可选项:chrome、firefox、edge(默认)、opera。使用该命令前请确保关闭所选的浏览器"
"自动从浏览器获取[yellow]cookie[/yellow]。可选项:chrome、firefox、edge、opera。使用该命令前请确保关闭所选的浏览器"
),
callback=handler_auto_cookie,
)
Expand Down
4 changes: 2 additions & 2 deletions f2/apps/tiktok/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def handler_auto_cookie(
return

# 根据浏览器选择获取cookie (Get cookies based on browser selection)
if value not in ["chrome", "firefox", "edge", "opera"]:
if value in ["chrome", "firefox", "edge", "opera"]:
try:
cookie_value = split_dict_cookie(get_cookie_from_browser(value))
manager = ConfigManager(ctx.params.get("config", "conf/app.yaml"))
Expand Down Expand Up @@ -272,7 +272,7 @@ def handler_naming(
"--auto-cookie",
type=click.Choice(["none", "chrome", "firefox", "edge", "opera"]),
default="none",
help=_("自动从浏览器获取cookie。可选项:chrome、firefox、edge(默认)、opera。使用该命令前请确保关闭所选的浏览器"),
help=_("自动从浏览器获取cookie。可选项:chrome、firefox、edge、opera。使用该命令前请确保关闭所选的浏览器"),
callback=handler_auto_cookie,
)
@click.option(
Expand Down

0 comments on commit 88cb625

Please sign in to comment.