1 import { wait } from '@shared/core-utils'
2 import { HttpStatusCode } from '@shared/models'
3 import { unwrapBody, unwrapBodyOrDecodeToJSON, unwrapTextOrDecode } from '../requests'
4 import { AbstractCommand, OverrideCommandOptions } from '../shared'
6 export class StreamingPlaylistsCommand extends AbstractCommand {
8 async get (options: OverrideCommandOptions & {
10 withRetry?: boolean // default false
13 const { withRetry, currentRetry = 1 } = options
16 const result = await unwrapTextOrDecode(this.getRawRequest({
21 defaultExpectedStatus: HttpStatusCode.OK_200
26 if (!withRetry || currentRetry > 5) throw err
34 currentRetry: currentRetry + 1
39 getFragmentedSegment (options: OverrideCommandOptions & {
43 return unwrapBody<Buffer>(this.getRawRequest({
49 defaultExpectedStatus: HttpStatusCode.OK_200
53 getSegmentSha256 (options: OverrideCommandOptions & {
56 return unwrapBodyOrDecodeToJSON<{ [ id: string ]: string }>(this.getRawRequest({
61 defaultExpectedStatus: HttpStatusCode.OK_200