From ce09d683d542d684ba5788d629eb2a63c793c486 Mon Sep 17 00:00:00 2001 From: HerbertHe Date: Sun, 3 Mar 2024 17:08:15 +0800 Subject: [PATCH] fix :bug: : fix error for txt source --- src/utils/m3u2txt.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils/m3u2txt.ts b/src/utils/m3u2txt.ts index c9f0467490d8..1ad0a2d2b985 100644 --- a/src/utils/m3u2txt.ts +++ b/src/utils/m3u2txt.ts @@ -17,10 +17,15 @@ export const m3u2txt = (m3uArray: string[]) => { if (groups.has(g)) { groups.set( g, - `${groups.get(g)}${reg[2].trim()},${m3uArray[i + 1]}\n` + `${groups.get(g)}${reg[2].trim().replace(/\s+/g, "_")},${ + m3uArray[i + 1] + }\n` ) } else { - groups.set(g, `${reg[2].trim()},${m3uArray[i + 1]}\n`) + groups.set( + g, + `${reg[2].trim().replace(/\s+/g, "_")},${m3uArray[i + 1]}\n` + ) } }