1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Support reinjecting token in private m3u8 playlist

This commit is contained in:
Chocobozzz 2022-12-02 14:47:21 +01:00
parent 04509c4325
commit 71e3e879c0
No known key found for this signature in database
GPG key ID: 583A612D890159BE
22 changed files with 391 additions and 48 deletions

View file

@ -2,7 +2,7 @@
import { expect } from 'chai'
import { basename } from 'path'
import { expectStartWith } from '@server/tests/shared'
import { checkVideoFileTokenReinjection, expectStartWith } from '@server/tests/shared'
import { areScalewayObjectStorageTestsDisabled, getAllFiles, getHLS } from '@shared/core-utils'
import { HttpStatusCode, LiveVideo, VideoDetails, VideoPrivacy } from '@shared/models'
import {
@ -191,6 +191,20 @@ describe('Object storage for video static file privacy', function () {
}
})
it('Should reinject video file token', async function () {
this.timeout(120000)
const videoFileToken = await server.videoToken.getVideoFileToken({ videoId: privateVideoUUID })
await checkVideoFileTokenReinjection({
server,
videoUUID: privateVideoUUID,
videoFileToken,
resolutions: [ 240, 720 ],
isLive: false
})
})
it('Should update public video to private', async function () {
this.timeout(60000)
@ -315,6 +329,26 @@ describe('Object storage for video static file privacy', function () {
await checkLiveFiles(permanentLive, permanentLiveId)
})
it('Should reinject video file token in permanent live', async function () {
this.timeout(240000)
const ffmpegCommand = sendRTMPStream({ rtmpBaseUrl: permanentLive.rtmpUrl, streamKey: permanentLive.streamKey })
await server.live.waitUntilPublished({ videoId: permanentLiveId })
const video = await server.videos.getWithToken({ id: permanentLiveId })
const videoFileToken = await server.videoToken.getVideoFileToken({ videoId: video.uuid })
await checkVideoFileTokenReinjection({
server,
videoUUID: permanentLiveId,
videoFileToken,
resolutions: [ 720 ],
isLive: true
})
await stopFfmpeg(ffmpegCommand)
})
it('Should have created a replay of the normal live with a private static path', async function () {
this.timeout(240000)