mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 12:42:06 +00:00
fix(downloader): fix playabilityStatus
This commit is contained in:
@ -261,12 +261,12 @@ async function downloadSongUnsafe(
|
|||||||
|
|
||||||
let playabilityStatus = info.playability_status;
|
let playabilityStatus = info.playability_status;
|
||||||
let bypassedResult = null;
|
let bypassedResult = null;
|
||||||
if (playabilityStatus.status === 'LOGIN_REQUIRED') {
|
if (playabilityStatus?.status === 'LOGIN_REQUIRED') {
|
||||||
// Try to bypass the age restriction
|
// Try to bypass the age restriction
|
||||||
bypassedResult = await getAndroidTvInfo(id);
|
bypassedResult = await getAndroidTvInfo(id);
|
||||||
playabilityStatus = bypassedResult.playability_status;
|
playabilityStatus = bypassedResult.playability_status;
|
||||||
|
|
||||||
if (playabilityStatus.status === 'LOGIN_REQUIRED') {
|
if (playabilityStatus?.status === 'LOGIN_REQUIRED') {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`[${playabilityStatus.status}] ${playabilityStatus.reason}`,
|
`[${playabilityStatus.status}] ${playabilityStatus.reason}`,
|
||||||
);
|
);
|
||||||
@ -275,7 +275,7 @@ async function downloadSongUnsafe(
|
|||||||
info = bypassedResult;
|
info = bypassedResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playabilityStatus.status === 'UNPLAYABLE') {
|
if (playabilityStatus?.status === 'UNPLAYABLE') {
|
||||||
const errorScreen =
|
const errorScreen =
|
||||||
playabilityStatus.error_screen as PlayerErrorMessage | null;
|
playabilityStatus.error_screen as PlayerErrorMessage | null;
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
Reference in New Issue
Block a user