diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-22 14:28:03 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-07-26 11:29:31 +0200 |
commit | 83903cb65d531a6b6b91715387493ba8312b264d (patch) | |
tree | fd172e26a483331e74f15a062743a9d40d4016d3 /shared/extra-utils/videos/streaming-playlists.ts | |
parent | c4fa01f7c45b66b112ebd08abce744b7c4041feb (diff) | |
download | PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.tar.gz PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.tar.zst PeerTube-83903cb65d531a6b6b91715387493ba8312b264d.zip |
Generate random uuid for video files
Diffstat (limited to 'shared/extra-utils/videos/streaming-playlists.ts')
-rw-r--r-- | shared/extra-utils/videos/streaming-playlists.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/shared/extra-utils/videos/streaming-playlists.ts b/shared/extra-utils/videos/streaming-playlists.ts index 1ae3fefc1..db40c27be 100644 --- a/shared/extra-utils/videos/streaming-playlists.ts +++ b/shared/extra-utils/videos/streaming-playlists.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { expect } from 'chai' | 1 | import { expect } from 'chai' |
2 | import { basename } from 'path' | ||
2 | import { sha256 } from '@server/helpers/core-utils' | 3 | import { sha256 } from '@server/helpers/core-utils' |
3 | import { HttpStatusCode, VideoStreamingPlaylist } from '@shared/models' | 4 | import { HttpStatusCode, VideoStreamingPlaylist } from '@shared/models' |
4 | import { PeerTubeServer } from '../server' | 5 | import { PeerTubeServer } from '../server' |
@@ -16,7 +17,8 @@ async function checkSegmentHash (options: { | |||
16 | 17 | ||
17 | const playlist = await command.get({ url: `${baseUrlPlaylist}/${videoUUID}/${resolution}.m3u8` }) | 18 | const playlist = await command.get({ url: `${baseUrlPlaylist}/${videoUUID}/${resolution}.m3u8` }) |
18 | 19 | ||
19 | const videoName = `${videoUUID}-${resolution}-fragmented.mp4` | 20 | const file = hlsPlaylist.files.find(f => f.resolution.id === resolution) |
21 | const videoName = basename(file.fileUrl) | ||
20 | 22 | ||
21 | const matches = /#EXT-X-BYTERANGE:(\d+)@(\d+)/.exec(playlist) | 23 | const matches = /#EXT-X-BYTERANGE:(\d+)@(\d+)/.exec(playlist) |
22 | 24 | ||