From 261dac403a6380ea46f4f0bee8d50c6f661fbdfa Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 15 May 2023 15:41:31 +0200 Subject: More robust test --- shared/server-commands/videos/streaming-playlists-command.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'shared/server-commands') diff --git a/shared/server-commands/videos/streaming-playlists-command.ts b/shared/server-commands/videos/streaming-playlists-command.ts index 87aacc5f6..b988ac4b2 100644 --- a/shared/server-commands/videos/streaming-playlists-command.ts +++ b/shared/server-commands/videos/streaming-playlists-command.ts @@ -14,7 +14,7 @@ export class StreamingPlaylistsCommand extends AbstractCommand { withRetry?: boolean // default false currentRetry?: number }): Promise { - const { videoFileToken, reinjectVideoFileToken, withRetry = false, currentRetry = 1 } = options + const { videoFileToken, reinjectVideoFileToken, expectedStatus, withRetry = false, currentRetry = 1 } = options try { const result = await unwrapTextOrDecode(this.getRawRequest({ @@ -29,6 +29,11 @@ export class StreamingPlaylistsCommand extends AbstractCommand { 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 -- cgit v1.2.3