Skip to content

数据格式(V2 / V1 旧版)

This content is not available in your language yet.

本页定义每个扩展入口的输入参数和返回结构,与 JavaScript 扩展 (V2) / Go 扩展 中的入口函数一一对应。

  • V2(当前标准)watch() 返回镜像列表,mirror(url) 再解析为下方的按类型播放结构。新扩展必须使用 V2。
  • V1(旧版兼容)watch() 直接返回最终播放结构,没有 mirror() 步骤——详见页尾数据格式(V1 旧版)。仅存量扩展参考。
latest(page: number)
search(kw: string, page: number, filter?: string)
detail(url: string)
watch(url: string)
mirror(url: string)
checkUpdate(url: string)
unload() { }
load(){}
export interface ListItem {
title: string;
url: string;
cover: string;
update?: string;
type?: string;
image?: string;
headers?: { [key: string]: string };
}
示例响应
{
"title": "One Piece",
"url": "https://example.com/one-piece",
"cover": "https://example.com/covers/one-piece.jpg",
"update": "EP 1122",
"type": "bangumi"
}
export interface Detail {
title: string;
cover: string;
desc?: string;
description?: string;
headers?: { [key: string]: string };
chapters?: Chapter[];
}
export interface Chapter {
title: string;
urls: {
name: string;
url: string;
}[];
}
示例响应
{
"title": "One Piece",
"cover": "https://example.com/covers/one-piece.jpg",
"desc": "Gol D. Roger was known as the Pirate King...",
"chapters": [
{
"title": "East Blue",
"urls": ["https://example.com/one-piece/ep/1", "..."]
},
{
"title": "Alabasta",
"urls": ["https://example.com/one-piece/ep/62", "..."]
}
]
}

Watch — watch 返回值(V2 镜像列表)

Section titled “Watch — watch 返回值(V2 镜像列表)”
export interface WatchList {
title?: string;
url?: string;
type?: string;
groups?: {
title: string;
mirrors: {
name: string;
url: string;
headers?: { [key: string]: string };
}[];
}[];
}
示例响应
{
"title": "One Piece Episode 1",
"url": "https://example.com/one-piece/ep/1",
"type": "bangumi",
"groups": [
{
"title": "Sub",
"mirrors": [
{ "name": "CDN 1", "url": "https://cdn1.example.com/video.m3u8" },
{ "name": "CDN 2", "url": "https://cdn2.example.com/video.m3u8" }
]
}
]
}

BangumiWatch — mirror 返回值(bangumi)

Section titled “BangumiWatch — mirror 返回值(bangumi)”
export interface BangumiWatch {
type: "hls" | "mp4" | "torrent" | "magnet";
url: string;
headers?: { [key: string]: string };
audioTrack?: string;
subtitles?: { language?: string; title: string; url: string }[];
tlsConfig?: {
profile: string;
userAgent?: string;
disableRedirect?: boolean;
insecureSkipVerify?: boolean;
};
}
带字幕和 TLS 指纹伪装的 HLS 镜像
{
"type": "hls",
"url": "https://cdn.example.com/video.m3u8",
"headers": { "Referer": "https://example.com/" },
"subtitles": [
{ "language": "en", "title": "English", "url": "https://cdn.example.com/subs/en.vtt" }
],
"tlsConfig": { "profile": "chrome_133" }
}
Torrent 镜像
{ "type": "torrent", "url": "https://example.com/files/ep1.torrent" }
export interface MangaWatch {
urls: string[];
headers?: { [key: string]: string };
}
export interface FikushonWatch {
content: string[];
title: string;
subtitle?: string;
}
漫画镜像
{ "urls": ["https://example.com/manga/ch1/p1.jpg", "https://example.com/manga/ch1/p2.jpg"] }
小说镜像
{ "content": ["It was a dark and stormy night..."], "title": "My Novel", "subtitle": "Chapter 1" }
// 仅 @type all 扩展使用,manga / fikushon / bangumi 三者只填充一个

每个项目只填充一个成员。

旧版 V1 扩展以 class extends Extension 方式编写,watch() 直接返回最终播放结构,没有 mirror() 步骤。其返回结构与上面 V2 的 BangumiWatch / MangaWatch / FikushonWatch 一致,区别仅在 watch 的契约:

class Extension {
latest(page) { /* ... */ }
search(kw, page, filter) { /* ... */ } // V1 同样接收 filter 参数,可忽略
detail(url) { /* ... */ }
watch(url) {
return { type: "hls", url: "https://.../a.m3u8", headers: {} };
}
load() { /* ... */ }
}