]>
Commit | Line | Data |
---|---|---|
57f879a5 C |
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 | }) { | |
dd0ebb71 | 24 | return unwrapBody<Buffer>(this.getRawRequest({ |
57f879a5 C |
25 | ...options, |
26 | ||
27 | url: options.url, | |
28 | range: options.range, | |
29 | implicitToken: false, | |
12edc149 | 30 | defaultExpectedStatus: HttpStatusCode.OK_200 |
57f879a5 C |
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 | } |