diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-13 14:36:30 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-13 14:36:30 +0100 |
commit | 5c0904fc664e3eb04ac75a9430c1297c2a14f853 (patch) | |
tree | 6ede3183976686f113aca6c06ba36b99cfe965f4 /shared/extra-utils | |
parent | 786b855af726599a9c877eefa6fa8508c36e1aca (diff) | |
download | PeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.tar.gz PeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.tar.zst PeerTube-5c0904fc664e3eb04ac75a9430c1297c2a14f853.zip |
Cleanup lives on server restart
Diffstat (limited to 'shared/extra-utils')
-rw-r--r-- | shared/extra-utils/videos/video-streaming-playlists.ts | 15 |
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 | ||
44 | async 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 | |||
44 | async function checkResolutionsInMasterPlaylist (playlistUrl: string, resolutions: number[]) { | 58 | async 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 | } |