Report live streams as unsupported instead of an empty quality list

This commit is contained in:
Jonathan Sykes
2026-08-24 01:07:18 +08:00
parent c141959654
commit 94fff8f862

View File

@@ -479,6 +479,13 @@ app.get('/api/streams', async (c) => {
}
qualities.sort((a, b) => b.height - a.height);
// Nothing proxyable (live streams only expose HLS manifests) — say so
// instead of handing the player an empty list it silently stalls on.
if (!qualities.length && !audioUrl) {
const live = info.is_live || info.live_status === 'is_live';
return c.json({ ok: false, error: live ? 'Live streams are not supported' : 'No playable formats for this video' }, 422);
}
return c.json({
ok: true,
data: {