]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/extra-utils/videos/streaming-playlists-command.ts
Introduce comments command
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / videos / streaming-playlists-command.ts
1
2 import { HttpStatusCode } from '../../core-utils/miscs/http-error-codes'
3 import { unwrapBody, unwrapText } from '../requests'
4 import { AbstractCommand, OverrideCommandOptions } from '../shared'
5
6 export class StreamingPlaylistsCommand extends AbstractCommand {
7
8 get (options: OverrideCommandOptions & {
9 url: string
10 }) {
11 return unwrapText(this.getRawRequest({
12 ...options,
13
14 url: options.url,
15 implicitToken: false,
16 defaultExpectedStatus: HttpStatusCode.OK_200
17 }))
18 }
19
20 getSegment (options: OverrideCommandOptions & {
21 url: string
22 range?: string
23 }) {
24 return unwrapText(this.getRawRequest({
25 ...options,
26
27 url: options.url,
28 range: options.range,
29 implicitToken: false,
30 defaultExpectedStatus: HttpStatusCode.OK_200
31 }))
32 }
33
34 getSegmentSha256 (options: OverrideCommandOptions & {
35 url: string
36 }) {
37 return unwrapBody<{ [ id: string ]: string }>(this.getRawRequest({
38 ...options,
39
40 url: options.url,
41 implicitToken: false,
42 defaultExpectedStatus: HttpStatusCode.OK_200
43 }))
44 }
45 }