From 5c0904fc664e3eb04ac75a9430c1297c2a14f853 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 13 Nov 2020 14:36:30 +0100 Subject: Cleanup lives on server restart --- shared/extra-utils/videos/video-streaming-playlists.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'shared/extra-utils/videos') diff --git a/shared/extra-utils/videos/video-streaming-playlists.ts b/shared/extra-utils/videos/video-streaming-playlists.ts index 8cf0e4930..b386e77c3 100644 --- a/shared/extra-utils/videos/video-streaming-playlists.ts +++ b/shared/extra-utils/videos/video-streaming-playlists.ts @@ -41,6 +41,20 @@ async function checkSegmentHash ( expect(sha256(res2.body)).to.equal(sha256Server) } +async function checkLiveSegmentHash ( + baseUrlSegment: string, + videoUUID: string, + segmentName: string, + hlsPlaylist: VideoStreamingPlaylist +) { + const res2 = await getSegment(`${baseUrlSegment}/${videoUUID}/${segmentName}`) + + const resSha = await getSegmentSha256(hlsPlaylist.segmentsSha256Url) + + const sha256Server = resSha.body[segmentName] + expect(sha256(res2.body)).to.equal(sha256Server) +} + async function checkResolutionsInMasterPlaylist (playlistUrl: string, resolutions: number[]) { const res = await getPlaylist(playlistUrl) @@ -62,5 +76,6 @@ export { getSegment, checkResolutionsInMasterPlaylist, getSegmentSha256, + checkLiveSegmentHash, checkSegmentHash } -- cgit v1.2.3