withRetry?: boolean // default false
currentRetry?: number
}): Promise<string> {
- const { videoFileToken, reinjectVideoFileToken, withRetry = false, currentRetry = 1 } = options
+ const { videoFileToken, reinjectVideoFileToken, expectedStatus, withRetry = false, currentRetry = 1 } = options
try {
const result = await unwrapTextOrDecode(this.getRawRequest({
defaultExpectedStatus: HttpStatusCode.OK_200
}))
+ // master.m3u8 could be empty
+ if (!result && (!expectedStatus || expectedStatus === HttpStatusCode.OK_200)) {
+ throw new Error('Empty result')
+ }
+
return result
} catch (err) {
if (!withRetry || currentRetry > 10) throw err