diff options
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 | ||