Skip to content

Instantly share code, notes, and snippets.

@lljxx1
Created October 15, 2020 00:49
Show Gist options
  • Select an option

  • Save lljxx1/48223dfe57bba12663c4627529253e8b to your computer and use it in GitHub Desktop.

Select an option

Save lljxx1/48223dfe57bba12663c4627529253e8b to your computer and use it in GitHub Desktop.
last.fm love
;(async () => {
for (let index = 0; index < temp1.length; index++) {
const line = temp1[index];
try {
await fetch("https://www.last.fm/user/fun00/loved", {
headers: {
accept: "*/*",
"accept-language": "zh-CN,zh;q=0.9,en-IN;q=0.8,en;q=0.7,ar;q=0.6",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
pragma: "no-cache",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-newrelic-id": "UwYPV15QGwYFXFlXDgU=",
"x-requested-with": "XMLHttpRequest",
},
referrer: "https://www.last.fm/user/fun00",
referrerPolicy: "strict-origin-when-cross-origin",
body:
"csrfmiddlewaretoken=SdoonTK4LO5UOSWse2arsVM0UbTqy6bO&action=love&track=" +
encodeURIComponent(line[0]) +
"&artist=" +
encodeURIComponent(line[1]) +
"&ajax=1",
method: "POST",
mode: "cors",
credentials: "include",
});
} catch (e) {}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment