This commit is contained in:
Dongho Kim
2026-06-22 02:48:01 +02:00
parent eaacddac55
commit 3dd505757d
+6 -3
View File
@@ -44,11 +44,14 @@ app.get('/stream/:channelId', async (req, res) => {
});
const data = response.data;
if (!data || !data.content || !data.content.livePlaybackJson) {
return res.status(404).send('Stream not found or offline');
const content = data && data.content;
const playbackJsonString = content && (content.livePlaybackJson || content.previewPlaybackJson);
if (!playbackJsonString) {
return res.status(404).send('Stream not found, offline, or region blocked');
}
const livePlayback = JSON.parse(data.content.livePlaybackJson);
const livePlayback = JSON.parse(playbackJsonString);
const media = livePlayback.media || [];
// Find HLS or LLHLS stream