feat(aria2): 新增 Aria2 RPC 导出功能(支持文件夹递归下载) - #344
Open
swlfigo wants to merge 1 commit into
Open
Conversation
在 115 文件列表每行 115 原生下载按钮旁增加「推送 Aria2」按钮, 点击文件直接推送、点击文件夹递归遍历后批量推送,补齐当前缺失的文件夹下载体验。 主要能力: - 文件 / 文件夹行内按钮;文件夹递归遍历子目录后批量推送,保留目录结构 - 支持多个 RPC 预设:0 个时显示配置引导、1 个时单按钮、≥2 个时下拉选择 - 独立设置面板:RPC 列表(带连通测试)、下载路径、递归间隔、SHA1 校验、UA / Referer / 自定义 Headers - 新增通用 MasterToast 组件,支持 info / success / error / loading 进度更新 - 推送时自动注入 115 的 Cookie / UA / Referer 到 aria2,下载端可通过 115 鉴权 - 单元测试覆盖 config / headers / rpc / walker 共 36 个用例
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
115 文件夹下载目前在脚本内直接
alert('当前未支持文件夹下载')(FileItemMod/download.ts:39),只能靠 115 原生下载且一次只能一个文件。本 PR 集成 aria2 JSON-RPC,补齐文件夹批量下载能力。主要变更
在文件列表每行的
.file-opr容器(即 115 原生下载按钮所在处)新增「推送 Aria2」按钮,按 RPC 预设数量自适应三种形态:⚙ 配置 Aria2— 引导打开设置面板⇩ <预设名>— 单按钮直接推送⇩ Aria2 ▾— hover 下拉选择drive115.getFiles带show_dir=1),批量推送所有文件,aria2 落盘时保留目录结构设置面板
通过行内下拉的「⚙ 设置」项打开,持久化到
GM_setValue('ARIA2_SETTINGS'):名称+URL,支持http://token:密钥@host:port/jsonrpc#k=v&k2=v2,行内「测试」按钮调用aria2.getVersion回显版本)Key: Value)架构
测试
utils/aria2/为纯逻辑层,覆盖了单元测试(Vitest):config.tsheaders.tsrpc.tswalker.ts全部通过:
pnpm --filter @115master/monkey test→ 36/36。手动冒烟(本机)
aria2c --enable-rpc --rpc-listen-all --rpc-secret=<密钥>http://token:<密钥>@localhost:6800/jsonrpc→ 点「测试」显示版本out含相对路径,目录结构保留Aria2logger 有堆栈兼容性
is115Browser为 true 时不渲染(与现有FileItemModDownload一致,115 浏览器内置不走代理)FileItemModExtMenu一致)userSettings没动,Aria2 配置持久化用独立 keyARIA2_SETTINGSChangeset
已随 PR 附上
@115master/monkeyminor bump。非目标 / 后续可选
limit=1150),超大目录后续可加分页