Skip to content

Data Formats (V2 / V1 legacy)

This page defines the input parameters and return structures of each extension entry point, and corresponds one-to-one with the entry functions in JavaScript Extensions (V2) / Go Extensions.

  • V2 (current standard): watch() returns a list of mirrors, then mirror(url) resolves it into the per-type shapes below. New extensions must use V2.
  • V1 (legacy-compatible): watch() returns the final playback shape directly, with no mirror() step — see Data Formats (V1, legacy) at the bottom. Reference only for existing extensions; JavaScript Extensions V1 (legacy) covers its syntax.
// Recently Updated
latest(page: number)
// Search
search(kw: string, page: number, filter?: string)
// Get Details
detail(url: string)
// Watch: returns a list of mirrors (V2)
watch(url: string)
// Resolve the chosen mirror into the final playback shape (V2)
mirror(url: string)
// Check for Updates for Episodes/Chapters (returns string)
checkUpdate(url: string)
// Called when unloading
unload() { }
// Called when loading
load(){}
export interface ListItem {
title: string;
url: string;
cover: string;
update?: string;
type?: string;
image?: string;
headers?: { [key: string]: string };
}
Sample response
{
"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;
}[];
}
Sample response
{
"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 — returned by watch (V2 mirror list)

Section titled “Watch — returned by watch (V2 mirror list)”
export interface WatchList {
title?: string;
url?: string;
type?: string;
groups?: {
title: string;
mirrors: {
name: string;
url: string;
headers?: { [key: string]: string };
}[];
}[];
}
Sample response
{
"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 — returned by mirror (bangumi)

Section titled “BangumiWatch — returned by 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;
};
}
HLS mirror with subtitles and TLS fingerprinting
{
"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" },
{ "language": "zh", "title": "中文", "url": "https://cdn.example.com/subs/zh.vtt" }
],
"audioTrack": "ja",
"tlsConfig": { "profile": "chrome_133", "insecureSkipVerify": true }
}
Torrent mirror
{ "type": "torrent", "url": "https://example.com/files/ep1.torrent" }
Magnet mirror
{ "type": "magnet", "url": "magnet:?xt=urn:btih:abc123def456&dn=One+Piece+EP1" }

For torrent/magnet content types, the URL carries the raw .torrent link or magnet: URI. Torrent resolution is handled by the frontend or a separate backend endpoint.

export interface MangaWatch {
urls: string[];
headers?: { [key: string]: string };
}
Sample response
{
"urls": [
"https://example.com/manga/ch1/p1.jpg",
"https://example.com/manga/ch1/p2.jpg",
"https://example.com/manga/ch1/p3.jpg"
],
"headers": { "Referer": "https://example.com/" }
}

FikushonWatch — returned by mirror (fikushon)

Section titled “FikushonWatch — returned by mirror (fikushon)”
export interface FikushonWatch {
content: string[];
title: string;
subtitle?: string;
}
Sample response
{
"content": [
"It was a dark and stormy night...",
"The hero stepped forward.",
"And so the journey began."
],
"title": "My Novel",
"subtitle": "Chapter 1"
}

AllMirror — returned by watch (@type all)

Section titled “AllMirror — returned by watch (@type all)”
// Only used for @type all extensions.
// One of manga / fikushon / bangumi will be populated.

Only one member is populated per item.

Legacy V1 extensions are written as class extends Extension; watch() returns the final playback shape directly, with no mirror() step. The return structures are the same as the V2 BangumiWatch / MangaWatch / FikushonWatch above — only the watch contract differs:

// V1 entry points (compatibility reference)
class Extension {
latest(page) { /* ... */ }
search(kw, page, filter) { /* ... */ } // V1 receives filter too; may be ignored
detail(url) { /* ... */ }
watch(url) {
// returns the final playback shape directly, e.g.:
return { type: "hls", url: "https://.../a.m3u8", headers: {} };
// or manga: { urls: [...] } / fikushon: { content: [...], title, subtitle }
}
load() { /* ... */ }
}