async function search(loc_id) {
const res = await
fetch(`[Link]
{loc_id}&show_nearby=false&skip_recent_tab=false`, {
"headers": {
"accept": "/",
"accept-language": "en-US,en;q=0.9,id;q=0.8",
"cache-control": "no-cache",
"pragma": "no-cache",
"priority": "u=1, i",
"sec-ch-prefers-color-scheme": "dark",
"sec-ch-ua": "\"Not/A)Brand\";v=\"8\", \"Chromium\";v=\"126\"",
"sec-ch-ua-full-version-list":
"\"Not/A)Brand\";v=\"[Link]\", \"Chromium\";v=\"126.0.6478.56\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-model": "\"\"",
"sec-ch-ua-platform": "\"Linux\"",
"sec-ch-ua-platform-version": "\"6.1.0\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-asbd-id": "129477",
"x-csrftoken": [Link](/csrftoken=([\w\d]+); /)[1] ?? '',
"x-ig-app-id": "936619743392459",
"x-ig-www-claim": "hmac.AR3F4jZAP9zLJfaCMqsFT-
I5N9rMUZnKkqqUNOxbRgxJ63jS",
"x-requested-with": "XMLHttpRequest"
},
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "include"
});
const {native_location_data: {ranked: json}} = await [Link]();
const medias = [Link](f => f.feed_type == 'media').map(m =>
m.layout_content.[Link](e => [Link])).flat();
const dat = [Link](med => ({ link: `[Link]
{[Link]}`, content: ([Link]?.text || '').trim() }));
if(json.more_available) {
const _next = await next(json.next_media_ids, json.next_max_id,
json.next_page)
return [...dat, ..._next];
}
return dat
}
async function next(nmid, nmax, np) {
const res = await
fetch("[Link] {
"headers": {
"accept": "/",
"accept-language": "en-US,en;q=0.9,id;q=0.8",
"content-type": "application/x-www-form-urlencoded",
"priority": "u=1, i",
"sec-ch-prefers-color-scheme": "dark",
"sec-ch-ua": "\"Not/A)Brand\";v=\"8\", \"Chromium\";v=\"126\"",
"sec-ch-ua-full-version-list":
"\"Not/A)Brand\";v=\"[Link]\", \"Chromium\";v=\"126.0.6478.56\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-model": "\"\"",
"sec-ch-ua-platform": "\"Linux\"",
"sec-ch-ua-platform-version": "\"6.1.0\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-asbd-id": "129477",
"x-csrftoken": [Link](/csrftoken=([\w\d]+); /)[1] ??
'',
"x-ig-app-id": "936619743392459",
"x-ig-www-claim": "hmac.AR3F4jZAP9zLJfaCMqsFT-
I5N9rMUZnKkqqUNOxbRgxJ63jS",
"x-instagram-ajax": "1014685373",
"x-requested-with": "XMLHttpRequest"
},
"referrerPolicy": "strict-origin-when-cross-origin",
"body": `surface=grid&tab=ranked&max_id=$
{encodeURIComponent(nmax)}&next_media_ids=${encodeURIComponent('[' +
[Link](i =>"${i}").join(', ') + ']')}&page=${np}`,
"method": "POST",
"mode": "cors",
"credentials": "include"
});
const json = await [Link]();
const medias = [Link](f => f.feed_type == 'media').map(m =>
m.layout_content.[Link](e => [Link])).flat();
const dat = [Link](med => ({ link: `[Link]
{[Link]}`, content: ([Link]?.text || '').trim() }));
return dat;
}
;(async () => {
[Link] = '';
const result = await search(800636694);
[Link] = '<table border="1">' + [Link](e =>
`<tr><td>${[Link]}</td><td>${[Link]}</td></tr>`).join('') + '</table>'
})();