mirror of
https://github.com/iptv-org/iptv
synced 2026-10-21 18:46:20 -04:00
Merge pull request #55266 from Dev-next-gen/fix/mpd-invalid-manifest
fix: don't abort playlist:format on an unparseable .mpd response
This commit is contained in:
1 file changed
+16
-12
+16
-12
@@ -175,22 +175,26 @@ export async function getStreamInfo(
|
|||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
} else if (url.includes('.mpd')) {
|
} else if (url.includes('.mpd')) {
|
||||||
const manifest = parseManifest(data, {
|
try {
|
||||||
manifestUri: url,
|
const manifest = parseManifest(data, {
|
||||||
eventHandler: ({ type, message }) => console.log(`${type}: ${message}`)
|
manifestUri: url,
|
||||||
})
|
eventHandler: ({ type, message }) => console.log(`${type}: ${message}`)
|
||||||
|
})
|
||||||
|
|
||||||
const playlist = orderBy(manifest.playlists, [p => p.attributes.BANDWIDTH], ['desc'])[0]
|
const playlist = orderBy(manifest.playlists, [p => p.attributes.BANDWIDTH], ['desc'])[0]
|
||||||
|
|
||||||
if (playlist) {
|
if (playlist) {
|
||||||
const attr = playlist.attributes
|
const attr = playlist.attributes
|
||||||
|
|
||||||
info = {
|
info = {
|
||||||
resolution: { width: attr.RESOLUTION.width, height: attr.RESOLUTION.height },
|
resolution: { width: attr.RESOLUTION.width, height: attr.RESOLUTION.height },
|
||||||
bandwidth: attr.BANDWIDTH,
|
bandwidth: attr.BANDWIDTH,
|
||||||
frameRate: attr['FRAME-RATE'],
|
frameRate: attr['FRAME-RATE'],
|
||||||
codecs: attr.CODECS
|
codecs: attr.CODECS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
// do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user