Siwan said:
How to unfavorite in 2020? the link redirect me to somewhere.
This is no longer possible through the HTML interface. Instead, open your development console (F12) and paste the following Javascript code into the console:
(async function (user_id) {
page = 0;
iteration = 1;
while (true) {
favorites = await $.getJSON('/favorites.json',{search:{user_id:user_id},limit:200,page:'a'+page,only:'id,post_id,post[is_banned]'});
banned_favs = favorites.filter((favorite)=>favorite.post.is_banned);
console.log(`Batch #${iteration++}: Deleting ${banned_favs.length} favorites.`);
for(i=0;i<banned_favs.length;i++) {
try {
await $.post(`/favorites/${banned_favs[i].post_id}.json`,{_method:'delete'});
} catch(e) {
console.warn('post #'+banned_favs[i].post_id,e?.status,e?.responseText);
}
}
if (favorites.length<200) {
break;
}
page=favorites[0].id;
}
Danbooru.Utility.notice('Done deleting banned favorites.');
})(Danbooru.CurrentUser.data('id'));
The above "should" work and I've tested out all of the components on both Chrome and Firefox, though I haven't tested deleting from either a banned artist or their paid work (double banned) as I would only get one shot.