- waitUntilSegmentUpload (options: OverrideCommandOptions & {
- playlistNumber: number
- segment: number
- totalSessions?: number
- }) {
- const { playlistNumber, segment, totalSessions = 1 } = options
- const segmentName = `${playlistNumber}-00000${segment}.ts`
+ while (error) {
+ try {
+ await this.getRawRequest({
+ ...options,
+
+ url: `${baseUrl}/${videoUUID}/${segmentName}`,
+ implicitToken: false,
+ defaultExpectedStatus: HttpStatusCode.OK_200
+ })
+
+ const video = await server.videos.get({ id: videoUUID })
+ const hlsPlaylist = video.streamingPlaylists[0]
+
+ const shaBody = await server.streamingPlaylists.getSegmentSha256({ url: hlsPlaylist.segmentsSha256Url })
+
+ if (!shaBody[segmentName]) {
+ throw new Error('Segment SHA does not exist')
+ }