fix: don't abort playlist:format on an unparseable .mpd response

getStreamInfo() already ignores .m3u8 responses that hls-parser cannot read, but the .mpd branch let parseManifest() throw. A stream URL ending in .mpd that answers 200 with an HTML page makes mpd-parser throw DASH_INVALID_XML, which rejects inside eachLimit and kills playlist:format before anything is saved. playlist:update hits the same path when adding a stream.
This commit is contained in:
leoca committed 2026-10-14 01:06:34 +00:00
1 parent ffee614552
commit 783c4b5d5a
1 file changed
+4
+4
View File
@@ -175,6 +175,7 @@ export async function getStreamInfo(
// do nothing // do nothing
} }
} else if (url.includes('.mpd')) { } else if (url.includes('.mpd')) {
try {
const manifest = parseManifest(data, { const manifest = parseManifest(data, {
manifestUri: url, manifestUri: url,
eventHandler: ({ type, message }) => console.log(`${type}: ${message}`) eventHandler: ({ type, message }) => console.log(`${type}: ${message}`)
@@ -192,6 +193,9 @@ export async function getStreamInfo(
codecs: attr.CODECS codecs: attr.CODECS
} }
} }
} catch {
// do nothing
}
} }
return info return info