diff --git a/unfollow_all.js b/unfollow_all.js index b76e7f1..7893aa3 100644 --- a/unfollow_all.js +++ b/unfollow_all.js @@ -24,11 +24,17 @@ async function unfollowUser(user) { the = the.username; e = await fetch(`https://scratch.mit.edu/site-api/users/followers/${the}/remove/?usernames=${user}`, { "method": "PUT", + "body": "{}", "headers": { "x-csrftoken": getCookie('scratchcsrftoken') } }); - e = await e.json(); + e = await e.text(); + try { + e = JSON.parse(e); + } catch (err) { + e = {}; + } console.log(e); if (e.success) { gek++;