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
This commit is contained in:
NoLogicAlan committed 2026-10-28 02:56:30 +03:00
1 parent c007bb93f8
commit 91e7812c30
2 files changed
+4 -3

No files matched your search

+2 -3
View File
@@ -9,7 +9,6 @@
*/ */
import { EmbedBuilder } from "@fluxerjs/core"; import { EmbedBuilder } from "@fluxerjs/core";
import { getGlobalColor } from "../../ui/index.mjs";
import { Utils } from "../../utils/Utils.mjs"; import { Utils } from "../../utils/Utils.mjs";
import { logger } from "../../core/Logger.mjs"; import { logger } from "../../core/Logger.mjs";
import meta from "../probe.mjs"; import meta from "../probe.mjs";
@@ -219,8 +218,8 @@ const DisplayMixin = {
const data = await meta(current.url); const data = await meta(current.url);
radioLiveTitle = data?.title || null; 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`; 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) { } catch (_) {
logger.warn("[Player] Error:", e?.message); /* 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`; 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") { } else if (current.type === "external" || current.type === "stream") {
+2
View File
@@ -16,8 +16,10 @@ const PROBE_TIMEOUT_MS = 15_000;
*/ */
export default function probe(file) { export default function probe(file) {
return new Promise((res, rej) => { return new Promise((res, rej) => {
const isHttp = typeof file === "string" && file.startsWith("http");
const args = [ const args = [
"-hide_banner", "-hide_banner",
...(isHttp ? ["-icy", "1", "-analyzeduration", "1000000"] : []),
"-show_entries", "format_tags:format=duration", "-show_entries", "format_tags:format=duration",
"-print_format", "json", "-print_format", "json",
"-i", file, "-i", file,