Removed console.log

This commit is contained in:
killer069
2021-08-24 21:24:05 +05:30
parent 353ff1e0f6
commit 7f827d6085
3 changed files with 4 additions and 5 deletions

View File

@@ -119,8 +119,7 @@ export async function playlist_info(url : string, parseIncomplete : boolean) {
let response = JSON.parse(body.split("var ytInitialData = ")[1].split(";</script>")[0])
if(response.alerts){
if(response.alerts[0].alertWithButtonRenderer?.type === 'INFO') {
if(parseIncomplete) console.log(`While parsing playlist url\n ${response.alerts[0].alertWithButtonRenderer.text.simpleText}`)
else throw new Error(`While parsing playlist url\n ${response.alerts[0].alertWithButtonRenderer.text.simpleText}`)
if(!parseIncomplete) throw new Error(`While parsing playlist url\n ${response.alerts[0].alertWithButtonRenderer.text.simpleText}`)
}
else if(response.alerts[0].alertRenderer?.type === 'ERROR') throw new Error(`While parsing playlist url\n ${response.alerts[0].alertRenderer.text.runs[0].text}`)
else throw new Error('While parsing playlist url\n Unknown Playlist Error')