Danbooru

How to unfavorite loli entries.

Posted under General

iridescent_slime said:

One of those posts was just a short woman which had been wrongly tagged as loli, so I went ahead and fixed that. The other is post #5223634. Even if you can't see the image on that post, you should still be able to click the unfavorite link as far as I'm aware.

Thing is, once the pic is among the other 700 fav'd pics, the post number is impossible to find since loli/shota tagged pics dont even have placeholders, unless there's some other way to find these kind of posts I'm unaware of.

Updated

kit009 said:

Thing is, once the pic is among the other 700 fav'd pics, the post number is impossible to find since loli/shota tagged pics dont even have placeholders, unless there's some other way to find these kind of posts I'm unaware of.

try ctrl+F

Copied and adjusted the following from forum #178040.

(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[id]'});
        console.log(`Batch #${iteration++}: Checking ${favorites.length} favorites.`);
        for(let i = 0; i < favorites.length; i++) {
            if (!Number.isInteger(favorites[i].post.id)) {
                console.log("Unfavoriting post #", favorites[i].post_id);
                try {
                    await $.post(`/favorites/${favorites[i].post_id}.json`, {_method: 'delete'});
                } catch(e) {
                    console.warn('post #' + favorites[i].post_id, e?.status, e?.responseText);
                }
            }
        }
        if (favorites.length < 200) {
            break;
        }
        page = favorites[0].id;
    }
    Danbooru.Utility.notice('Done checking favorites.');
})(Danbooru.CurrentUser.data('id'));

Just open the dev console for your browser (F12 on Chrome/Firefox), then copy and paste the above into it. It'll delete every favorite that is not visible to your account.

BrokenEagle98 said:

Copied and adjusted the following from forum #178040.

Just open the dev console for your browser (F12 on Chrome/Firefox), then copy and paste the above into it. It'll delete every favorite that is not visible to your account.

Thank you. Worked like a charm.

1