Small Error Update

This commit is contained in:
killer069
2021-08-29 18:29:06 +05:30
parent 5a73280e84
commit 675c5c3e41
3 changed files with 3 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ export async function video_basic_info(url : string){
let body = await url_get(new_url)
let player_response = JSON.parse(body.split("var ytInitialPlayerResponse = ")[1].split("}};")[0] + '}}')
if(player_response.playabilityStatus.status === 'ERROR') throw new Error(`While getting info from url \n ${player_response.playabilityStatus.reason}`)
if(player_response.playabilityStatus.status === 'LOGIN_REQUIRED') throw new Error(`While getting info from url \n ${player_response.playabilityStatus.messages[0]}`)
if(player_response.playabilityStatus.status === 'LOGIN_REQUIRED') throw new Error(`While getting info from url \n ${ player_response.playabilityStatus.reason || player_response.playabilityStatus.messages[0]}`)
let html5player = 'https://www.youtube.com' + body.split('"jsUrl":"')[1].split('"')[0]
let format = []
let vid = player_response.videoDetails