From 91e7812c3048024decb25f14e888d9531103228f Mon Sep 17 00:00:00 2001 From: NoLogicAlan Date: Wed, 28 Oct 2026 02:56:30 +0300 Subject: [PATCH] fix(player): add ICY support to probe and suppress false-alarm radio metadata warnings - Add -icy 1 and -analyzeduration flags to probe.mjs for Shoutcast/Icecast HTTP streams - Silently fall back to station display without logging logger.warn when stream metadata is unavailable --- src/music/player/DisplayMixin.mjs | 5 ++--- src/music/probe.mjs | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/music/player/DisplayMixin.mjs b/src/music/player/DisplayMixin.mjs index 7ca9b06..e604467 100644 --- a/src/music/player/DisplayMixin.mjs +++ b/src/music/player/DisplayMixin.mjs @@ -9,7 +9,6 @@ */ import { EmbedBuilder } from "@fluxerjs/core"; -import { getGlobalColor } from "../../ui/index.mjs"; import { Utils } from "../../utils/Utils.mjs"; import { logger } from "../../core/Logger.mjs"; import meta from "../probe.mjs"; @@ -219,8 +218,8 @@ const DisplayMixin = { const data = await meta(current.url); radioLiveTitle = data?.title || null; textMsg = `${vcLine}šŸ“» **[${current.title}](${current.author?.url || current.url})**\n${current.description || ""}\n\nšŸŽµ Now playing: ${radioLiveTitle || "Unknown"}\n\nšŸ”‰ ${vol} │ ${loopqueue} Queue │ ${songloop} Song │ ${autoplay} Autoplay`; - } catch (e) { - logger.warn("[Player] Error:", e?.message); + } catch (_) { + /* Radio live metadata probe is optional — gracefully fall back to station display */ textMsg = `${vcLine}šŸ“» **[${current.title}](${current.author?.url || current.url})**\n\nšŸ”‰ ${vol} │ ${loopqueue} Queue │ ${songloop} Song │ ${autoplay} Autoplay`; } } else if (current.type === "external" || current.type === "stream") { diff --git a/src/music/probe.mjs b/src/music/probe.mjs index 41ad76d..9cfdf0d 100644 --- a/src/music/probe.mjs +++ b/src/music/probe.mjs @@ -16,8 +16,10 @@ const PROBE_TIMEOUT_MS = 15_000; */ export default function probe(file) { return new Promise((res, rej) => { + const isHttp = typeof file === "string" && file.startsWith("http"); const args = [ "-hide_banner", + ...(isHttp ? ["-icy", "1", "-analyzeduration", "1000000"] : []), "-show_entries", "format_tags:format=duration", "-print_format", "json", "-i", file,