aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/video-streaming-playlists.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/videos/video-streaming-playlists.ts')
-rw-r--r--shared/extra-utils/videos/video-streaming-playlists.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/shared/extra-utils/videos/video-streaming-playlists.ts b/shared/extra-utils/videos/video-streaming-playlists.ts
index b386e77c3..99c2e1880 100644
--- a/shared/extra-utils/videos/video-streaming-playlists.ts
+++ b/shared/extra-utils/videos/video-streaming-playlists.ts
@@ -2,16 +2,17 @@ import { makeRawRequest } from '../requests/requests'
2import { sha256 } from '../../../server/helpers/core-utils' 2import { sha256 } from '../../../server/helpers/core-utils'
3import { VideoStreamingPlaylist } from '../../models/videos/video-streaming-playlist.model' 3import { VideoStreamingPlaylist } from '../../models/videos/video-streaming-playlist.model'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
5 6
6function getPlaylist (url: string, statusCodeExpected = 200) { 7function getPlaylist (url: string, statusCodeExpected = HttpStatusCode.OK_200) {
7 return makeRawRequest(url, statusCodeExpected) 8 return makeRawRequest(url, statusCodeExpected)
8} 9}
9 10
10function getSegment (url: string, statusCodeExpected = 200, range?: string) { 11function getSegment (url: string, statusCodeExpected = HttpStatusCode.OK_200, range?: string) {
11 return makeRawRequest(url, statusCodeExpected, range) 12 return makeRawRequest(url, statusCodeExpected, range)
12} 13}
13 14
14function getSegmentSha256 (url: string, statusCodeExpected = 200) { 15function getSegmentSha256 (url: string, statusCodeExpected = HttpStatusCode.OK_200) {
15 return makeRawRequest(url, statusCodeExpected) 16 return makeRawRequest(url, statusCodeExpected)
16} 17}
17 18
@@ -33,7 +34,7 @@ async function checkSegmentHash (
33 const offset = parseInt(matches[2], 10) 34 const offset = parseInt(matches[2], 10)
34 const range = `${offset}-${offset + length - 1}` 35 const range = `${offset}-${offset + length - 1}`
35 36
36 const res2 = await getSegment(`${baseUrlSegment}/${videoUUID}/${videoName}`, 206, `bytes=${range}`) 37 const res2 = await getSegment(`${baseUrlSegment}/${videoUUID}/${videoName}`, HttpStatusCode.PARTIAL_CONTENT_206, `bytes=${range}`)
37 38
38 const resSha = await getSegmentSha256(hlsPlaylist.segmentsSha256Url) 39 const resSha = await getSegmentSha256(hlsPlaylist.segmentsSha256Url)
39 40