mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Put private videos under a specific subdirectory
This commit is contained in:
parent
38a3ccc7f8
commit
3545e72c68
105 changed files with 2929 additions and 1308 deletions
31
shared/server-commands/videos/video-token-command.ts
Normal file
31
shared/server-commands/videos/video-token-command.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/no-floating-promises */
|
||||
|
||||
import { HttpStatusCode, VideoToken } from '@shared/models'
|
||||
import { unwrapBody } from '../requests'
|
||||
import { AbstractCommand, OverrideCommandOptions } from '../shared'
|
||||
|
||||
export class VideoTokenCommand extends AbstractCommand {
|
||||
|
||||
create (options: OverrideCommandOptions & {
|
||||
videoId: number | string
|
||||
}) {
|
||||
const { videoId } = options
|
||||
const path = '/api/v1/videos/' + videoId + '/token'
|
||||
|
||||
return unwrapBody<VideoToken>(this.postBodyRequest({
|
||||
...options,
|
||||
|
||||
path,
|
||||
implicitToken: true,
|
||||
defaultExpectedStatus: HttpStatusCode.OK_200
|
||||
}))
|
||||
}
|
||||
|
||||
async getVideoFileToken (options: OverrideCommandOptions & {
|
||||
videoId: number | string
|
||||
}) {
|
||||
const { files } = await this.create(options)
|
||||
|
||||
return files.token
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue