Files
netdisk-fast-download/web-service/src/main/resources/app-dev.yml
T
qaiuandCursor Agent 542d246aab Parse Ctfile shares with the new url API and ALTCHA v2 (#303)
* Parse Ctfile shares with the new url API and ALTCHA v2

The legacy getfile.php and getdir.php endpoints now answer every share
with Cloudflare Turnstile. Password-free files and folders use ALTCHA
PBKDF2 instead: solve it off the event loop, reuse access_pass for the
same owner, and fetch the direct link from POST /url/download. Password
shares stay on Turnstile and are reported separately from missing links
and wrong or missing passwords.

Co-authored-by: qaiu <[email protected]>

* 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]>

* Parse password-protected Ctfile shares with anonymous ALTCHA

A password share's first response is often labeled Turnstile, but a fresh
ALTCHA token plus the passcode returns the file. Try that before any login.
Keep the v4 client only as a fallback when Turnstile remains and a token is
configured. Live checks download the sample PDF and a directory zip.

Co-authored-by: qaiu <[email protected]>

---------

Co-authored-by: Cursor Agent <[email protected]>
2026-11-24 16:14:43 +08:00

157 lines
5.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 服务配置
server:
port: 6400
contextPath: /
# 使用数据库
enableDatabase: true
# 服务域名或者IP 生成二维码链接时需要,不设置则自动从请求地址获取
# domainName: http://127.0.0.1:6401
# 预览服务URL
previewURL: https://nfd-parser.github.io/nfd-preview/preview.html?src=
# auth参数加密密钥(16位AES密钥)
authEncryptKey: 'nfd_auth_key2026'
# 反向代理服务器配置路径(不用加后缀)
proxyConf: server-proxy
# JS演练场配置
playground:
# 是否启用演练场,默认false不启用
enabled: false
# 公开模式,默认false需要密码访问,设为true则无需密码
public: false
# 私有模式启用前请填写实例专属密码;留空或沿用旧版默认密码将禁用演练场。
password: ''
# vertx核心线程配置(一般无需改的), 为0表示eventLoopPoolSize将会采用默认配置(CPU核心*2) workerPoolSize将会采用默认20
vertx:
eventLoopPoolSize: 0
workerPoolSize: 0
# vertx-service配置(一般无需改的)
custom:
# 异步服务线程数
asyncServiceInstances: 4
# server路由(controller层)所在包路径
baseLocations: cn.qaiu.lz
# 路由处理默认超时时间(毫秒)
routeTimeOut: 15000
# 拦截器匹配规则
ignoresReg:
# - /v2/statisticsInfo
- .*/test.*$
# 参数注入的实体类包路径匹配正则 (防止同名类引发歧义)
entityPackagesReg:
- ^cn\.qaiu\.lz\.web\.model\..*
# 限流配置
#rateLimit:
# # 是否启用限流
# enable: true
# # 限流的请求数
# limit: 10
# # 限流的时间窗口(单位秒)
# timeWindow: 10
# # 路径匹配规则
# pathReg: ^/v2/.*
# 数据源配置
dataSource:
# PGSQL配置示例
#jdbcUrl: jdbc:postgresql://localhost:5432/zzzmy
# MySQL配置示例
#jdbcUrl: jdbc:mysql://127.0.0.1:3306/nfddata?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
# 内置数据源H2db配置
jdbcUrl: jdbc:h2:file:./db/nfdData;MODE=MySQL;DATABASE_TO_UPPER=FALSE
username: root
password: '123456'
# 直链缓存相关配置
cache:
# 该配置未使用,后续加入其他Cache实现时,区分类型
type: h2db
# 默认时长: 单位分钟,大部分网盘未严格验证,建议不要太大
defaultDuration: 5
# 具体网盘的缓存配置(单位:分钟)
# - 配置 key 且有值(如 le: 2879):使用指定时长
# - 配置 key 但无值(如 fc:):使用上面的 defaultDuration
# - 未配置的 key:不缓存,每次都请求网盘API
# 格式:网盘标识: 时长
duration:
# ---- 网盘类 ----
ce: 5 # Cloudreve
cow: 5 # 奶牛快传
ct: 30 # 城通网盘
ec: 5 # 移动云空间
fc: # 亿方云
fj: 20 # 小飞机网盘 链接有效期约30分钟
fs: # 飞书云盘
iz: 20 # 蓝奏云优享 链接有效期约30分钟
kd: # 可道云
le: 2879 # 联想乐云
lz: 30 # 蓝奏云 链接有效期约45分钟
other: # 其他网盘
p115: 30 # 115网盘
pdb: # Dropbox
pcx: # 超星云盘(需要 referer 头)
pgd: # Google Drive
pic: # iCloud
pod: # OneDrive
pvyy: # 微雨云存储
pwps: # WPS云文档
qk: # 夸克网盘
qq: 9999999 # QQ邮箱中转站 (iwx.mail.qq.com/ftn/download)
qqsc: # QQ闪传 (qfile.qq.com)
qqw: 30 # QQ邮箱云盘 (wx.mail.qq.com/s)
uc: # UC网盘
ws: 10 # 文叔叔
ye: -1 # 123网盘
# ---- 音乐类 ----
baidu_photo: 5 # 百度网盘相册
migu: 5 # 咪咕音乐
mkg: 30 # 酷狗音乐
mkgs: # 酷狗音乐分享短链
mkgs2: # 酷狗音乐分享2(share/*.html)
mkws: # 酷我音乐分享
mmgs: # 咪咕音乐分享短链
mne: 30 # 网易云音乐
mnes: # 网易云音乐分享短链
mqq: 30 # QQ音乐
mqqs: # QQ音乐分享短链
qishui_music: 5 # 汽水音乐
# httpClient静态代理服务器配置(外网代理)
proxy:
# - panTypes: pgd,pdb,pod
# type: http # 支持http/socks4/socks5
# host: 127.0.0.1
# port: 7890
# username:
# password:
### 解析认证相关
auths:
# 夸克:小文件可免登录。大文件(访客 23018)再填本机 Cookie。空值等于没配。
# 公共解析站没有共用夸克账号。
# qk:
# cookie:
# 123:公共云解析不能共用账号。优先填 authorization(浏览器 authorToken / sso-token,不要带 Bearer)。
# 账号密码触发验证码时会失败并提示改用 Authorization,本项目不处理验证码。
# 5112 / 请登录后下载 / 您需要注册登录或付费后下载 是上游要求登录。
ye:
username:
password:
# authorization:
# 城通:免密和带访问密码的分享都先匿名解 ALTCHA,通常不用登录。
# 只有匿名结果仍是 Turnstile 时,下面的令牌才会作为可选回退。
# 浏览器打开 https://pan.ctfile.com 并登录,F12 → Application → Session Storage,
# 复制 refresh_token。token 可空,填了就当作当前 access token,过期后用 refresh_token 刷新。
# 刷新若轮换了 refresh_token,进程内会写回这份配置和 TokenCache;重启前请把新值保存回本文件。
# 目录分享类型是 ctd,这里只配 ct 也会被目录解析回退使用。
# ct:
# refresh_token:
# token: