From 32a572b35a98e9539132032bea0b1cb0d688b2f4 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Sun, 4 Aug 2024 16:33:28 +0900 Subject: [PATCH] fix(downloader): fix `playabilityStatus` --- src/plugins/downloader/main/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/downloader/main/index.ts b/src/plugins/downloader/main/index.ts index 84b4f1e8cc..d4b6672903 100644 --- a/src/plugins/downloader/main/index.ts +++ b/src/plugins/downloader/main/index.ts @@ -261,12 +261,12 @@ async function downloadSongUnsafe( let playabilityStatus = info.playability_status; let bypassedResult = null; - if (playabilityStatus.status === 'LOGIN_REQUIRED') { + if (playabilityStatus?.status === 'LOGIN_REQUIRED') { // Try to bypass the age restriction bypassedResult = await getAndroidTvInfo(id); playabilityStatus = bypassedResult.playability_status; - if (playabilityStatus.status === 'LOGIN_REQUIRED') { + if (playabilityStatus?.status === 'LOGIN_REQUIRED') { throw new Error( `[${playabilityStatus.status}] ${playabilityStatus.reason}`, ); @@ -275,7 +275,7 @@ async function downloadSongUnsafe( info = bypassedResult; } - if (playabilityStatus.status === 'UNPLAYABLE') { + if (playabilityStatus?.status === 'UNPLAYABLE') { const errorScreen = playabilityStatus.error_screen as PlayerErrorMessage | null; throw new Error(