Spotify Work + Error Language = EN - US

This commit is contained in:
killer069
2021-09-09 12:11:11 +05:30
parent 139b540a2c
commit 0b4979f009
9 changed files with 211 additions and 28 deletions

View File

@@ -47,7 +47,7 @@ export async function video_basic_info(url : string, cookie? : string){
else video_id = url
let new_url = `https://www.youtube.com/watch?v=${video_id}`
let body = await url_get(new_url, {
headers : (cookie) ? { 'cookie' : cookie } : {}
headers : (cookie) ? { 'cookie' : cookie, 'accept-language' : 'en-US,en-IN;q=0.9,en;q=0.8,hi;q=0.7' } : {'accept-language' : 'en-US,en-IN;q=0.9,en;q=0.8,hi;q=0.7'}
})
let player_response = JSON.parse(body.split("var ytInitialPlayerResponse = ")[1].split("}};")[0] + '}}')
let initial_response = JSON.parse(body.split("var ytInitialData = ")[1].split("}};")[0] + '}}')
@@ -129,7 +129,9 @@ export async function playlist_info(url : string, parseIncomplete : boolean = fa
else Playlist_id = url
let new_url = `https://www.youtube.com/playlist?list=${Playlist_id}`
let body = await url_get(new_url)
let body = await url_get(new_url, {
headers : {'accept-language' : 'en-US,en-IN;q=0.9,en;q=0.8,hi;q=0.7'}
})
let response = JSON.parse(body.split("var ytInitialData = ")[1].split(";</script>")[0])
if(response.alerts){
if(response.alerts[0].alertWithButtonRenderer?.type === 'INFO') {