aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-13 14:36:30 +0100
committerChocobozzz <me@florianbigard.com>2020-11-13 14:36:30 +0100
commit5c0904fc664e3eb04ac75a9430c1297c2a14f853 (patch)
tree6ede3183976686f113aca6c06ba36b99cfe965f4 /shared/extra-utils/videos
parent786b855af726599a9c877eefa6fa8508c36e1aca (diff)
downloadPeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.tar.gz
PeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.tar.zst
PeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.zip
Cleanup lives on server restart
Diffstat (limited to 'shared/extra-utils/videos')
-rw-r--r--shared/extra-utils/videos/video-streaming-playlists.ts15
1 files changed, 15 insertions, 0 deletions
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 (
41 expect(sha256(res2.body)).to.equal(sha256Server) 41 expect(sha256(res2.body)).to.equal(sha256Server)
42} 42}
43 43
44async function checkLiveSegmentHash (
45 baseUrlSegment: string,
46 videoUUID: string,
47 segmentName: string,
48 hlsPlaylist: VideoStreamingPlaylist
49) {
50 const res2 = await getSegment(`${baseUrlSegment}/${videoUUID}/${segmentName}`)
51
52 const resSha = await getSegmentSha256(hlsPlaylist.segmentsSha256Url)
53
54 const sha256Server = resSha.body[segmentName]
55 expect(sha256(res2.body)).to.equal(sha256Server)
56}
57
44async function checkResolutionsInMasterPlaylist (playlistUrl: string, resolutions: number[]) { 58async function checkResolutionsInMasterPlaylist (playlistUrl: string, resolutions: number[]) {
45 const res = await getPlaylist(playlistUrl) 59 const res = await getPlaylist(playlistUrl)
46 60
@@ -62,5 +76,6 @@ export {
62 getSegment, 76 getSegment,
63 checkResolutionsInMasterPlaylist, 77 checkResolutionsInMasterPlaylist,
64 getSegmentSha256, 78 getSegmentSha256,
79 checkLiveSegmentHash,
65 checkSegmentHash 80 checkSegmentHash
66} 81}