Open API

Publish anime

POST /api/releases/publish — publish with an API Key. Idempotency-Key binds the complete request from first acceptance. Changed requests return 409 CONFLICT; unfinished legacy uploads without a binding return legacy_request_binding_missing. Use a new key for either case. Publishing a version the group already has returns 409 CONFLICT with error.reason RELEASE_VERSION_EXISTS. A torrentStorageId whose torrent another release or another user's unexpired preview already uses returns 409 CONFLICT with error.reason TORRENT_IN_USE. See Conventions and authentication for replay and 503 retry rules.

POST
/api/releases/publish

Authorization

headerAuthorizationBearer <token>

字幕组 API Key。Authorization: Bearer <KEY>。与 X-API-Key 二选一,Bearer 优先。 Key scope:releases:publish、releases:delete、releases:sync:read,至少选一个。

Header Parameters

Idempotency-Key?string

同一 API Key 和端点的同一普通发布请求重试复用此值。已提交或已删除的旧命令返回原回执;删除后重新发布使用新值。不提供或为空时按新命令处理;超过 256 字符返回 422 VALIDATION_ERROR。跨站浏览器预检目前不允许此头。

Length1 <= length <= 256

Request Body

  1. body
animeIdType*string
Value in"bgm""anilist""mal""anidb"
animeId*string

animeIdType 对应的番剧 ID,或该站点的番剧链接;按来源规范化后解析。

Length1 <= length <= 200
title?string

省略时使用种子内部名称。

Length1 <= length <= 500
magnetBase64?string

省略时从上传种子提取。传入时须含 v1 infohash(xt=urn:btih 后接 40 位十六进制或 32 位 base32,xt 键不区分大小写,可与 urn:btmh 同用且不论先后);不合法时返回 422 VALIDATION_ERROR。

Length1 <= length
notes?string
Lengthlength <= 50000
trackers?string

单个表单字段,换行分隔或 JSON 数组字符串。

episode?integer
Range0 <= value <= 9007199254740991
episodeKey?string

数字集号按规范写法保存:去掉前导零,小数再去掉末尾的零。05.5 和 5.50 都存为 5.5,01 存为 1,01-13 存为 1-13。

Length1 <= length <= 40
version?string
Length1 <= length <= 20
resolution?string

省略时只从标题里写明分辨率的片段推断(如 1080p、1920x1080、独立成词的 4K),集数和裸数字不算;标题里没有时再看种子内部名,都没有时为 1080p。规则见端点说明。

Value in"4K""2160p""1080p""720p""480p""360p"
language?string

单个表单字段,逗号分隔或 JSON 数组字符串,如 CHS,JP 或 ["CHS","JP"]。

subtitle?string
Value in"EXTERNAL""INTERNAL""EMBEDDED""NONE"
format?string
Value in"MKV""MP4""AVI""WEBM"
fileSize?integer
Range0 <= value <= 9007199254740991
publishedAt?integer
Range-9007199254740991 <= value <= 9007199254740991
preview?boolean
nyaa?boolean
publishToNyaa?boolean
nyaaCategory?NyaaCategory

Nyaa 分类代码。中文动画字幕常用 1_3。 1_1 Anime - AMV;1_2 English-translated;1_3 Non-English-translated;1_4 Raw; 2_1 Audio Lossless;2_2 Audio Lossy; 3_1 Literature English;3_2 Literature Non-English;3_3 Literature Raw; 4_1 Live Action English;4_2 Idol/PV;4_3 Live Action Non-English;4_4 Live Action Raw; 5_1 Pictures Graphics;5_2 Pictures Photos; 6_1 Software Applications;6_2 Software Games。

Value in"1_1""1_2""1_3""1_4""2_1""2_2""3_1""3_2""3_3""4_1""4_2""4_3""4_4""5_1""5_2""6_1""6_2"
nyaaComplete?boolean
nyaaRemake?boolean
nyaaDescription?string

自定义 Nyaa 说明,最多 10240 个字符,与 Nyaa 的上限一致;按字符计,首尾空白不计。超出返回 422 VALIDATION_ERROR。

Lengthlength <= 10240
nyaaInformation?string
Lengthlength <= 500
torrent*file

必须上传 .torrent 文件;文件内容用于提取磁力、大小及默认标题。

Formatbinary

Response Body

主记录已写入

application/json
  1. response
ok*true
Value intrue
result*
Example Request
curl -X POST 'https://anibt.net/api/releases/publish' \  -H 'Content-Type: application/json' \  -d '{  "animeIdType": "bgm",  "animeId": "string",  "title": "string",  "magnetBase64": "string",  "torrentStorageId": "string"}'

{  "ok": true,  "result": {    "releaseId": "rel_example",    "revision": 1,    "torrentObjectId": "obj_example"  }}