mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-20 03:03:43 +08:00
feat: Implement user-defined video sources and danmaku API management with new settings pages and a dedicated store.
This commit is contained in:
@@ -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(',');
|
||||
|
||||
Reference in New Issue
Block a user