Using seeds

种子接口总览

Seed API overview

种子能力暴露在 POST /fs/seed/* 下(旧 /fs/torrent/* 路由仍兼容):

接口用途
parse解析种子(自动探测 .oss / .torrent / .cas
upload_parse上传种子文件并解析
generate生成种子(见生成种子
convert格式转换
diagnose诊断转换缺失信息
capabilities能力预检:文件已提供哈希 / 是否需下载 / 流式支持;或探测目标存储的秒传方式
rapid_upload秒传保存
offline_download离线下载 / 中转保存
update编辑 / 重算 / 删除文件
update_channels更新渠道(成功后写入 channels / missing_channels
quick_save快捷保存(rapid_upload / offline_download 的别名)

所有种子载荷均以 Base64 编码在请求体内传输。统一操作请求体 SeedOperationRequest 常见字段:

字段说明
seed_dataBase64 编码的种子内容(同时兼容 content / data / torrent_data 别名)
file_name原始种子文件名
path / target_path目标保存目录
selected_files选中文件的下标数组(针对种子内 files[]
update_channel是否在成功后更新渠道
remove_files待删除的文件路径
recalc_files待重算的文件(path + source_path
hash_matrix重算用的内容矩阵

Seed capability is exposed under POST /fs/seed/* (the legacy /fs/torrent/* routes remain compatible):

APIPurpose
parseParse a seed (auto-detects .oss / .torrent / .cas)
upload_parseUpload a seed file and parse it
generateGenerate a seed (see Generating seeds)
convertConvert between formats
diagnoseDiagnose missing information for conversion
capabilitiesPreflight: per-file hashes available / download needed / streamable; or probe a destination storage’s save methods
rapid_uploadRapid-upload save
offline_downloadOffline download / relayed transfer
updateEdit / recalculate / remove files
update_channelsUpdate channels (write channels / missing_channels on success/failure)
quick_saveQuick save (alias of rapid_upload / offline_download)

All seed payloads are base64-encoded in the request body. Common SeedOperationRequest fields:

FieldDescription
seed_database64 seed content (aliases content / data / torrent_data also accepted)
file_nameoriginal seed file name
path / target_pathdestination directory
selected_filesindices into the seed’s files[]
update_channelwhether to update channels on success
remove_filesfile paths to remove
recalc_filesfiles to recalculate (path + source_path)
hash_matrixhash matrix for recalculation

秒传保存

Rapid upload

勾选文件后选择目标网盘和路径,界面会展示目标驱动支持的秒传方式(如天翼云 CAS)以及当前是否可秒传。系统优先使用原生秒传,若目标驱动无法复用哈希,会明确提示 unavailable,不会静默降级。

秒传保存的逐文件判定(capabilities 返回的 method):

方法含义徽章颜色
189pc_cas目标为天翼云,且种子含 CAS 秒传所需 MD5 + 分片 MD5,可秒传绿
put_url种子含可用直链,可 PutURL 服务器端拉取绿
offline_download走离线下载工具
download_required无法复用哈希,需服务器流式下载后再上传
unavailable目标驱动不支持任何可用方式

只有 189pc_casput_url 属于真正的「秒传」,无需下载文件内容。

Select files and choose a destination drive/path. The UI shows the destination drive’s supported rapid-upload methods (e.g. 189pc CAS) and whether rapid upload is currently possible. Native rapid upload is preferred; if the drive cannot reuse hashes, the operation reports unavailable instead of silently degrading.

Per-file save decision (method returned by capabilities):

MethodMeaningBadge
189pc_casdestination is 189pc and the seed has the MD5 + piece MD5 CAS needs, so rapid upload worksgreen
put_urlthe seed has a usable direct link, so PutURL pulls server-sidegreen
offline_downloadfalls back to an offline download toolblue
download_requiredhashes cannot be reused; the server streams and re-uploadsyellow
unavailablethe destination drive supports no usable methodred

Only 189pc_cas and put_url are true "rapid upload" (no content download).

离线下载

Offline download

当种子内含可用直链/分享链接时,可将文件下载到目标网盘(PutURL / 离线工具 / 服务器流式)。BT 种子可通过 magnet 交给离线工具下载。

  • .torrent 种子:整体转 magnet 后交给离线工具(announcetrnamednlengthxl)。
  • 其它种子:逐文件按 sources/d/ 直链或 /sd/ 分享链接)离线下载。

When the seed contains usable direct/share sources, files can be downloaded into the destination drive (PutURL / offline tool / server streaming). Torrent seeds can be handed to an offline tool via magnet.

  • .torrent: converted to magnet as a whole (announcetr, namedn, lengthxl) and handed to the offline tool.
  • Other seeds: downloaded per file from sources (/d/ direct or /sd/ share links).

中转秒传

Relayed transfer

先选择一个中间网盘(支持原生秒传或 PutURL),保存后再服务器端复制到最终目标网盘。异步离线下载不可用于中转。

请求中设置 transit_path(中间路径)并携带 options: { mode: "transfer" },系统会先同步保存到中间存储,再复制到最终 path

Save synchronously into an intermediate drive (native rapid upload or PutURL), then copy server-side to the final drive. Asynchronous offline downloads cannot be relayed.

Set transit_path (the intermediate path) with options: { mode: "transfer" }; the system saves synchronously to the intermediate storage, then copies to the final path.

成功后更新渠道

Update channel on success

勾选「成功后更新渠道」后,秒传成功会把当前网盘追加到种子的 channels,失败则记录到 missing_channels,方便下次选择可秒传的驱动。

  • channels{ driver, mount_path } 数组,记录种子已成功落盘的渠道。
  • missing_channels:秒传失败的驱动名数组,避免下次重复尝试。

With "update channel on success" enabled, a successful save appends the current drive to the seed’s channels, while a failure is recorded in missing_channels.

  • channels: an array of { driver, mount_path } marking drives where the seed has landed successfully.
  • missing_channels: an array of drive names that failed rapid upload, avoiding repeat attempts.

格式转换

Convert

可将种子转换为其他格式。转换前会展示缺失信息,例如缺少 SHA-1 分片时无法转为 .torrent

  • 目标格式由 format / to_format / target_format 任一字段指定。
  • diagnose 接口可单独列出转换每个目标格式所需但缺失的哈希,前端据此显示 ✓/✗ 与缺失原因。
  • 转换的可行性规则与生成一致:.torrent 需 SHA-1 完整 + 分片;.cas 需 MD5 完整 + 分片(或 ≤ 10 MiB 的整文件 MD5)。

Convert between formats; missing information (e.g. no SHA-1 pieces) is reported before conversion.

  • The target format is given by format / to_format / target_format.
  • diagnose lists the hashes required but missing for each target format, driving the ✓/✗ UI and its reasons.
  • Feasibility mirrors generation: .torrent needs SHA-1 whole + pieces; .cas needs MD5 whole + pieces (or a whole-file MD5 for files ≤ 10 MiB).

编辑与重算

Edit and recalculate

  • 编辑:修改整体注释、tracker、渠道、每文件注释、分享直链;编辑时会校验分享链接是否仍有效(无效分享会明确提示其 ID)。
  • 重算:选择源目录后重算哈希(可勾选哈希矩阵)。源文件路径 = 源目录 + 种子内相对路径;重算只读服务端已有文件,不从外部下载。
  • 删除文件:通过 remove_files 从种子中移除指定文件。
  • Edit: update overall comment, trackers, channels, per-file comments, and share sources; share validity is checked during editing (invalid shares report their IDs).
  • Recalculate: pick a source directory and recompute hashes (with a selectable hash matrix). The source path is the source directory plus the seed’s relative path; recalculation only reads existing server-side files.
  • Remove files: drop specified files from the seed via remove_files.

文件操作侧车跟随

File-operation sidecar follow

对主文件执行复制 / 移动 / 重命名 / 删除时,可勾选「跟随传输种子侧车」,让伴随的 .oss / .torrent / .cas / .cas.torrent 一起操作,保持主文件与侧车一致。

操作接口follow_seed 行为
复制POST /fs/copy同步复制侧车到目标目录
移动POST /fs/move同步移动侧车到目标目录
重命名POST /fs/rename新名 + 原后缀 重命名侧车
删除POST /fs/remove同步删除侧车
  • 侧车路径规则:主文件路径 + .oss / .torrent / .cas / .cas.torrent
  • 仅对文件生效(目录不跟随);仅处理实际存在的侧车,缺失时静默跳过。

When copying / moving / renaming / deleting a main file, enable "Follow transfer seed sidecars" to move the companion .oss / .torrent / .cas / .cas.torrent along, keeping the main file and sidecars consistent.

OperationAPIfollow_seed behavior
CopyPOST /fs/copysynchronously copy sidecars to the destination
MovePOST /fs/movesynchronously move sidecars to the destination
RenamePOST /fs/renamerename sidecars to newName + original suffix
RemovePOST /fs/removesynchronously delete sidecars
  • Sidecar path rule: main path + .oss / .torrent / .cas / .cas.torrent.
  • Files only (directories are skipped); missing sidecars are silently ignored.

设置

Settings

设置说明默认
seed_site_url生成分享/直链使用的公开站点 URL
seed_default_matrix右键生成的默认内容矩阵md5/sha1/sha256 whole=true
seed_default_trackers生成时可选勾选的 tracker 列表
seed_default_format默认种子格式oss
seed_format_policies各格式自动生成开关全关
seed_auto_generate_policy全局自动生成策略off
seed_single_direct_preview单文件种子直接预览false
seed_cas_direct_access打开 CAS 立即秒传+预览false
每存储 seed_policy存储级 inherit/on/off 覆盖inherit
SettingDescriptionDefault
seed_site_urlPublic site URL for share/direct sourcesempty
seed_default_matrixDefault right-click hash matrixmd5/sha1/sha256 whole=true
seed_default_trackersTracker list offered at generationempty
seed_default_formatDefault seed formatoss
seed_format_policiesPer-format auto-generation switchesall off
seed_auto_generate_policyGlobal auto-generation policyoff
seed_single_direct_previewDirect preview for single-file seedsfalse
seed_cas_direct_accessRapid-upload and preview CAS on openfalse
per-storage seed_policyStorage-level inherit/on/off overrideinherit

Contributors