aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/live.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-23 11:20:00 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-07-26 11:29:31 +0200
commit764b1a14fc494f2cfd7ea590d2f07b01df65c7ad (patch)
tree198ca5f242c63a205a05fa4cfd6d063277c541fd /shared/extra-utils/videos/live.ts
parent83903cb65d531a6b6b91715387493ba8312b264d (diff)
downloadPeerTube-764b1a14fc494f2cfd7ea590d2f07b01df65c7ad.tar.gz
PeerTube-764b1a14fc494f2cfd7ea590d2f07b01df65c7ad.tar.zst
PeerTube-764b1a14fc494f2cfd7ea590d2f07b01df65c7ad.zip
Use random names for VOD HLS playlists
Diffstat (limited to 'shared/extra-utils/videos/live.ts')
-rw-r--r--shared/extra-utils/videos/live.ts18
1 files changed, 12 insertions, 6 deletions
diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts
index 502964b1a..94f5f5b59 100644
--- a/shared/extra-utils/videos/live.ts
+++ b/shared/extra-utils/videos/live.ts
@@ -76,7 +76,7 @@ async function waitUntilLivePublishedOnAllServers (servers: PeerTubeServer[], vi
76 } 76 }
77} 77}
78 78
79async function checkLiveCleanup (server: PeerTubeServer, videoUUID: string, resolutions: number[] = []) { 79async function checkLiveCleanupAfterSave (server: PeerTubeServer, videoUUID: string, resolutions: number[] = []) {
80 const basePath = server.servers.buildDirectory('streaming-playlists') 80 const basePath = server.servers.buildDirectory('streaming-playlists')
81 const hlsPath = join(basePath, 'hls', videoUUID) 81 const hlsPath = join(basePath, 'hls', videoUUID)
82 82
@@ -93,12 +93,18 @@ async function checkLiveCleanup (server: PeerTubeServer, videoUUID: string, reso
93 expect(files).to.have.lengthOf(resolutions.length * 2 + 2) 93 expect(files).to.have.lengthOf(resolutions.length * 2 + 2)
94 94
95 for (const resolution of resolutions) { 95 for (const resolution of resolutions) {
96 expect(files).to.contain(`${videoUUID}-${resolution}-fragmented.mp4`) 96 const fragmentedFile = files.find(f => f.endsWith(`-${resolution}-fragmented.mp4`))
97 expect(files).to.contain(`${resolution}.m3u8`) 97 expect(fragmentedFile).to.exist
98
99 const playlistFile = files.find(f => f.endsWith(`${resolution}.m3u8`))
100 expect(playlistFile).to.exist
98 } 101 }
99 102
100 expect(files).to.contain('master.m3u8') 103 const masterPlaylistFile = files.find(f => f.endsWith('-master.m3u8'))
101 expect(files).to.contain('segments-sha256.json') 104 expect(masterPlaylistFile).to.exist
105
106 const shaFile = files.find(f => f.endsWith('-segments-sha256.json'))
107 expect(shaFile).to.exist
102} 108}
103 109
104export { 110export {
@@ -107,5 +113,5 @@ export {
107 testFfmpegStreamError, 113 testFfmpegStreamError,
108 stopFfmpeg, 114 stopFfmpeg,
109 waitUntilLivePublishedOnAllServers, 115 waitUntilLivePublishedOnAllServers,
110 checkLiveCleanup 116 checkLiveCleanupAfterSave
111} 117}