Add Ctfile v4 login parsing for password-protected shares

Password shares are blocked by Turnstile on the anonymous web API. When a
refresh token or access token is configured, convert the share to an xtc
link and use the official client list and fetch-url calls. Password-free
shares still use ALTCHA. Tests use short synthetic fixtures only.

Co-authored-by: qaiu <[email protected]>
This commit is contained in:
Cursor Agentandqaiu committed 2026-11-24 05:08:07 +00:00
1 parent 0d133ee437
commit 62fa23542d
7 files changed
+965 -6

No files matched your search

@@ -145,3 +145,11 @@ auths:
username:
password:
# authorization:
# 城通:免密分享不需要登录。带访问密码的文件和目录要自己的客户端令牌。
# 浏览器打开 https://pan.ctfile.com 并登录,F12 → Application → Session Storage,
# 复制 refresh_token。token 可空,填了就当作当前 access token,过期后用 refresh_token 刷新。
# 刷新若轮换了 refresh_token,进程内会写回这份配置和 TokenCache;重启前请把新值保存回本文件。
# 目录分享类型是 ctd,这里只配 ct 也会被目录解析回退使用。
# ct:
# refresh_token:
# token: