From 83903cb65d531a6b6b91715387493ba8312b264d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 22 Jul 2021 14:28:03 +0200 Subject: Generate random uuid for video files --- shared/extra-utils/videos/streaming-playlists.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'shared/extra-utils/videos/streaming-playlists.ts') 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 @@ import { expect } from 'chai' +import { basename } from 'path' import { sha256 } from '@server/helpers/core-utils' import { HttpStatusCode, VideoStreamingPlaylist } from '@shared/models' import { PeerTubeServer } from '../server' @@ -16,7 +17,8 @@ async function checkSegmentHash (options: { const playlist = await command.get({ url: `${baseUrlPlaylist}/${videoUUID}/${resolution}.m3u8` }) - const videoName = `${videoUUID}-${resolution}-fragmented.mp4` + const file = hlsPlaylist.files.find(f => f.resolution.id === resolution) + const videoName = basename(file.fileUrl) const matches = /#EXT-X-BYTERANGE:(\d+)@(\d+)/.exec(playlist) -- cgit v1.2.3