set instagram specific headers

This commit is contained in:
dumbmoron 2023-08-20 22:18:49 +00:00
parent ba7137ef62
commit 9eb6700399

View file

@ -23,6 +23,9 @@ export default async function(obj) {
'User-Agent': genericUserAgent,
'X-Ig-App-Id': '936619743392459',
'X-Asbd-Id': '129477',
'x-ig-www-claim': cookie?._wwwClaim || '0',
'x-csrftoken': cookie?.values()?.csrftoken,
'x-requested-with': 'XMLHttpRequest',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
@ -32,6 +35,11 @@ export default async function(obj) {
cookie
}
})
if (data.headers.get('X-Ig-Set-Www-Claim') && cookie) {
cookie._wwwClaim = data.headers.get('X-Ig-Set-Www-Claim');
}
updateCookie(cookie, data.headers);
data = (await data.json()).data;
} catch (e) {
@ -92,3 +100,4 @@ export default async function(obj) {
return { error: 'ErrorEmptyDownload' }
}
}