aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands
diff options
context:
space:
mode:
Diffstat (limited to 'shared/server-commands')
-rw-r--r--shared/server-commands/videos/live-command.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/shared/server-commands/videos/live-command.ts b/shared/server-commands/videos/live-command.ts
index 2e4bc10b5..73f4eefd3 100644
--- a/shared/server-commands/videos/live-command.ts
+++ b/shared/server-commands/videos/live-command.ts
@@ -213,6 +213,7 @@ export class LiveCommand extends AbstractCommand {
213 213
214 while (error) { 214 while (error) {
215 try { 215 try {
216 // Check fragment exists
216 await this.getRawRequest({ 217 await this.getRawRequest({
217 ...options, 218 ...options,
218 219
@@ -224,12 +225,16 @@ export class LiveCommand extends AbstractCommand {
224 const video = await server.videos.get({ id: videoUUID }) 225 const video = await server.videos.get({ id: videoUUID })
225 const hlsPlaylist = video.streamingPlaylists[0] 226 const hlsPlaylist = video.streamingPlaylists[0]
226 227
228 // Check SHA generation
227 const shaBody = await server.streamingPlaylists.getSegmentSha256({ url: hlsPlaylist.segmentsSha256Url, withRetry: objectStorage }) 229 const shaBody = await server.streamingPlaylists.getSegmentSha256({ url: hlsPlaylist.segmentsSha256Url, withRetry: objectStorage })
228
229 if (!shaBody[segmentName]) { 230 if (!shaBody[segmentName]) {
230 throw new Error('Segment SHA does not exist') 231 throw new Error('Segment SHA does not exist')
231 } 232 }
232 233
234 // Check fragment is in m3u8 playlist
235 const subPlaylist = await server.streamingPlaylists.get({ url: `${baseUrl}/${video.uuid}/${playlistNumber}.m3u8` })
236 if (!subPlaylist.includes(segmentName)) throw new Error('Fragment does not exist in playlist')
237
233 error = false 238 error = false
234 } catch { 239 } catch {
235 error = true 240 error = true