feat: Implement user-defined video sources and danmaku API management with new settings pages and a dedicated store.

This commit is contained in:
kuekhaoyang
2026-02-19 11:56:14 +08:00
parent e1ea1a0d9a
commit 9ea9f85507
26 changed files with 1097 additions and 151 deletions
+6
View File
@@ -13,6 +13,8 @@ export interface M3UChannel {
routes?: string[];
sourceId?: string;
sourceName?: string;
httpUserAgent?: string;
httpReferrer?: string;
}
export interface M3UPlaylist {
@@ -40,6 +42,8 @@ export function parseM3U(content: string): M3UPlaylist {
const tvgLogoMatch = line.match(/tvg-logo="([^"]*)"/i);
const groupTitleMatch = line.match(/group-title="([^"]*)"/i);
const tvgIdMatch = line.match(/tvg-id="([^"]*)"/i);
const httpUserAgentMatch = line.match(/http-user-agent="([^"]*)"/i);
const httpReferrerMatch = line.match(/http-referrer="([^"]*)"/i);
if (tvgNameMatch) channel.tvgName = tvgNameMatch[1];
if (tvgLogoMatch) channel.logo = tvgLogoMatch[1];
@@ -48,6 +52,8 @@ export function parseM3U(content: string): M3UPlaylist {
if (channel.group) groupSet.add(channel.group);
}
if (tvgIdMatch) channel.tvgId = tvgIdMatch[1];
if (httpUserAgentMatch) channel.httpUserAgent = httpUserAgentMatch[1];
if (httpReferrerMatch) channel.httpReferrer = httpReferrerMatch[1];
// Extract channel name (after last comma)
const commaIndex = line.lastIndexOf(',');