PeerTube/shared/server-commands/videos/streaming-playlists-command.ts
Chocobozzz cfd57d2ca0
Live supports object storage
* Sync live files (segments, master playlist, resolution playlist,
   segment sha file) into object storage
 * Automatically delete them when the live ends
 * Segment sha file is now a file on disk, and not stored in memory
   anymore
2022-10-04 10:03:17 +02:00

45 lines
1.1 KiB
TypeScript

import { HttpStatusCode } from '@shared/models'
import { unwrapBody, unwrapTextOrDecode, unwrapBodyOrDecodeToJSON } from '../requests'
import { AbstractCommand, OverrideCommandOptions } from '../shared'
export class StreamingPlaylistsCommand extends AbstractCommand {
get (options: OverrideCommandOptions & {
url: string
}) {
return unwrapTextOrDecode(this.getRawRequest({
...options,
url: options.url,
implicitToken: false,
defaultExpectedStatus: HttpStatusCode.OK_200
}))
}
getFragmentedSegment (options: OverrideCommandOptions & {
url: string
range?: string
}) {
return unwrapBody<Buffer>(this.getRawRequest({
...options,
url: options.url,
range: options.range,
implicitToken: false,
defaultExpectedStatus: HttpStatusCode.OK_200
}))
}
getSegmentSha256 (options: OverrideCommandOptions & {
url: string
}) {
return unwrapBodyOrDecodeToJSON<{ [ id: string ]: string }>(this.getRawRequest({
...options,
url: options.url,
implicitToken: false,
defaultExpectedStatus: HttpStatusCode.OK_200
}))
}
}