Skip to content

Feat/add chromium support - #13

Open
HawkW1027 wants to merge 3 commits into
public-clis:mainfrom
HawkW1027:feat/add-chromium-support
Open

Feat/add chromium support#13
HawkW1027 wants to merge 3 commits into
public-clis:mainfrom
HawkW1027:feat/add-chromium-support

Conversation

@HawkW1027

Copy link
Copy Markdown

1. 新增 Chromium 支持 & 登录流程优化(c53daa0)

  • 在浏览器 Cookie 提取列表中新增 Chromium 支持
  • 重新设计登录流程:自动尝试所有已安装浏览器并逐一显示探测结果,失败后自动回退到二维码登录
  • 新增 --browser 选项,允许用户指定目标浏览器
  • 新增 --cookie-file 选项,支持从 JSON 文件导入 Cookie(适配非主流浏览器)
  • 重构浏览器探测逻辑,收集所有浏览器的探测结果而非在首次匹配时停止
  • 更新 README 文档:补充认证说明、使用示例及故障排查指引

2. 修复凭证验证时的网络超时处理 (db323d3)

  • TimeoutError、ConnectionError、OSError 原先会穿透到通用异常处理,导致在 API 不可达时将有效凭证误判为过期
    现已将网络超时视为不确定状态,不再错误标记凭证失效

3. 修复代理环境变量自动检测 (10d8aa9)

  • bilibili-api-python 的 AioHTTPClient 默认设置 proxy="",会覆盖 aiohttp 的 trust_env=True,导致系统代理被绕过
  • 现已自动从环境变量检测代理并通过 request_settings.set_proxy() 设置
  • 同时为 client.py 中的自定义 aiohttp session 添加 trust_env=True

- Add Chromium to browser cookie extraction list

- Redesign bili login: try all browsers with per-browser terminal feedback, then fall back to QR code login automatically

- Add --browser option to target a specific browser

- Add --cookie-file option for importing cookies from JSON file (for non-standard browsers)

- Refactor browser probe logic to collect all results instead of stopping at first match, enabling detailed user feedback

- Update README: authentication docs, usage examples, troubleshooting
…tion

TimeoutError, ConnectionError, and OSError were falling through to the
generic Exception handler, causing valid credentials to be reported as
expired when the bilibili API is unreachable or slow.

Made-with: Cursor
bilibili-api-python's AioHTTPClient defaults proxy="" which overrides
aiohttp's trust_env=True, bypassing system proxy (e.g. Clash on RPi).
Detect proxy from env vars and set it via request_settings.set_proxy().
Also add trust_env=True to custom aiohttp sessions in client.py.

Made-with: Cursor
@HawkW1027

Copy link
Copy Markdown
Author

ruff+mypy测试全部通过,目前自用顺利

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant