update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user