Report live streams as unsupported instead of an empty quality list
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user