使用 rookiepy 替代 browser-cookie3

This commit is contained in:
JoeanAmier
2024-07-27 17:27:55 +08:00
parent 5e33081e76
commit 3e67dfb634
11 changed files with 70 additions and 39 deletions

View File

@@ -101,9 +101,7 @@ class CLI:
@staticmethod
@check_value
def read_cookie(ctx: Context, param, value) -> str:
if len(value) == 1:
value = int(value)
return BrowserCookie.get(value, domain="xiaohongshu.com")
return BrowserCookie.get(value, domains=["xiaohongshu.com", ])
@staticmethod
@check_value
@@ -139,8 +137,8 @@ class CLI:
("--language", "-l", "choice", _("设置程序语言目前支持zh_CN、en_GB")),
("--settings", "-s", "str", _("读取指定配置文件")),
("--browser_cookie", "-bc", "choice",
fill(_("从指定的浏览器读取小红书网页版 Cookie需要关闭对应的浏览器,支持1 Chrome, 2 Chromium, 3 Opera, 4 Opera GX, "
"5 Brave, 6 Edge, 7 Vivaldi, 8 Firefox, 9 LibreWolf, 10 Safari输入浏览器类型或序号"), width=45)),
fill(_("从指定的浏览器读取小红书网页版 Cookie支持1 Arc, 2 Brave, 3 Chrome, 4 Chromium, "
"5 Edge, 6 Firefox, 7 LibreWolf, 8 Opera, 9 Vivaldi; 输入浏览器名称或序号"), width=40)),
("--update_settings", "-us", "flag", _("是否更新配置文件")),
("--help", "-h", "flag", _("查看详细参数说明")),
("--version", "-v", "flag", _("查看 XHS-Downloader 版本")),