+ const baseUrl = objectStorage
+ ? ObjectStorageCommand.getMockPlaylistBaseUrl() + 'hls'
+ : server.url + '/static/streaming-playlists/hls'
+
+ let error = true
+
+ 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')
+ }