From 140b39ecf75ad73627ed8cfb84bd9e4bfc98ddd6 Mon Sep 17 00:00:00 2001 From: Troray Date: Mon, 19 Jan 2026 22:32:39 +0800 Subject: [PATCH] Update m3u8-utils.ts --- lib/utils/m3u8-utils.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/utils/m3u8-utils.ts b/lib/utils/m3u8-utils.ts index 5ac078e..4ccac7b 100644 --- a/lib/utils/m3u8-utils.ts +++ b/lib/utils/m3u8-utils.ts @@ -22,13 +22,8 @@ export type AdFilterMode = 'off' | 'keyword' | 'heuristic' | 'aggressive'; export function filterM3u8Ad(content: string, baseUrl: string, mode: AdFilterMode = 'heuristic', customKeywords: string[] = []): string { if (!content) return ''; - // 1. Performance: Parse Keywords & Base URL ONLY ONCE - // Merge env keywords (build time) with custom keywords (runtime injected) - const envKeywordsStr = process.env.NEXT_PUBLIC_AD_KEYWORDS || ''; - const envKeywords = envKeywordsStr.split(/[\n,]/).map(k => k.trim()).filter(k => k); - - // Combine and deduplicate - const keywords = Array.from(new Set([...envKeywords, ...customKeywords])); + // Use keywords passed from AdKeywordsWrapper (already loaded from env/file) + const keywords = customKeywords; const basePath = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1); let origin = '';