From 8378056a04f02ad16445e352a4b95374e4716ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8A=88=EB=A6=AC=ED=8A=AC?= <9804cjh@naver.com> Date: Sat, 11 Sep 2021 21:08:04 +0900 Subject: [PATCH] Fix the problem when audioFormat's length is zero. In befor code, ```js if(opusFormats.length === 0){ type = StreamType.Arbitrary final.push(audioFormat[audioFormat.length - 1]) } else{ type = StreamType.WebmOpus final.push(opusFormats[opusFormats.length - 1]) } if(final.length === 0) { type = StreamType.Arbitrary final.push(info.format[info.format.length - 1]) } ``` length of final cannot be 0 coz it only check `opusFormats.length === 0`. --- play-dl/YouTube/stream.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/play-dl/YouTube/stream.ts b/play-dl/YouTube/stream.ts index 7de9d70..31891e6 100644 --- a/play-dl/YouTube/stream.ts +++ b/play-dl/YouTube/stream.ts @@ -59,17 +59,17 @@ export async function stream(url : string, cookie? : string): Promise