Hi!
Plz help me step by step because i don't know how using script on danbooru. Thx and greetings from Poland.
Posted under General
The simplest way is to search for your favorites (ordfav:rocklee_pl) and then change the mode in the top left from View to Unfavorite, then click all the thumbnails; repeat until done. You can also search for something like ordfav:rocklee_pl solo if you want to remove only certain favorites or at least start with something specific.
kittey said:
The simplest way is to search for your favorites (ordfav:rocklee_pl) and then change the mode in the top left from View to Unfavorite, then click all the thumbnails; repeat until done. You can also search for something like ordfav:rocklee_pl solo if you want to remove only certain favorites or at least start with something specific.
He wants to wipe all of his favorites, and he has 50k of them, so doing it manually is not going to work.
Unfavoriting 50k posts even with a script will take ages because of the rate limit of 1 unfavorite/second.
Nonetheless here is a userscript (install violentmonkey if you don't have a userscript manager yet) that adds a "delete all" button near your favorite count on your profile. It skips paid_rewards because banned ones aren't visible to you. If you run it on betabooru you could use -(paid_reward status:banned)
instead.
// ==UserScript== // @name nuke favs // @namespace Violentmonkey Scripts // @match https://*.donmai.us/profile // @grant none // @version 1.0 // @author - // @description 4/13/2022, 2:43:37 PM // ==/UserScript== const sleep = ms => new Promise(r => setTimeout(r, ms)); async function getPage() { let username = document.body.attributes["data-current-user-name"].value; return fetch(`/posts.json?tags=fav:${username}+-paid_reward&limit=200`).then(resp => resp.json()); } async function unfavoritePost(id) { return fetch(`/favorites/${id}.json`, { method: "delete", headers: { "x-csrf-token": Danbooru.Utility.meta("csrf-token") } }); } async function nuke() { let posts = await getPage(); while (true) { if (posts.length === 0) { posts = await getPage(); if (posts.length === 0) break; } let item = posts.pop(); if (item.id) { await unfavoritePost(item.id); console.log(`Unfavorited post ${item.id}`); await sleep(1000); } } alert("done"); } function nukeSync() { nuke().then(); } $(` <a href="javascript:void(0)">Delete all</a> `).click(nukeSync).appendTo(".user-statistics > tbody:nth-child(1) > tr:nth-child(8) > td:nth-child(2)");
Expect it to take in the ballpark of 14 hours to finish, possibly longer. I tested in with a couple dozens favorites on Testbooru and it seems to work, but it might be more scuffed with 50k. It'll print some messages to the console while running.
topic #20515 has a solution for the paid rewards instead.
Talulah said:
It skips paid_rewards because banned ones aren't visible to you.
Why not just skip status:banned?
kittey said:
Why not just skip status:banned?
Platinums can see status:banned. The real solution is to not exclude either and paginate past non-visible posts but I'm lazy.
Talulah said:
Unfavoriting 50k posts even with a script will take ages because of the rate limit of 1 unfavorite/second.
Nonetheless here is a userscript (install violentmonkey if you don't have a userscript manager yet) that adds a "delete all" button near your favorite count on your profile. It skips paid_rewards because banned ones aren't visible to you. If you run it on betabooru you could use
-(paid_reward status:banned)
instead.// ==UserScript== // @name nuke favs // @namespace Violentmonkey Scripts // @match https://*.donmai.us/profile // @grant none // @version 1.0 // @author - // @description 4/13/2022, 2:43:37 PM // ==/UserScript== const sleep = ms => new Promise(r => setTimeout(r, ms)); async function getPage() { let username = document.body.attributes["data-current-user-name"].value; return fetch(`/posts.json?tags=fav:${username}+-paid_reward&limit=200`).then(resp => resp.json()); } async function unfavoritePost(id) { return fetch(`/favorites/${id}.json`, { method: "delete", headers: { "x-csrf-token": Danbooru.Utility.meta("csrf-token") } }); } async function nuke() { let posts = await getPage(); while (true) { if (posts.length === 0) { posts = await getPage(); if (posts.length === 0) break; } let item = posts.pop(); if (item.id) { await unfavoritePost(item.id); console.log(`Unfavorited post ${item.id}`); await sleep(1000); } } alert("done"); } function nukeSync() { nuke().then(); } $(` <a href="javascript:void(0)">Delete all</a> `).click(nukeSync).appendTo(".user-statistics > tbody:nth-child(1) > tr:nth-child(8) > td:nth-child(2)");Expect it to take in the ballpark of 14 hours to finish, possibly longer. I tested in with a couple dozens favorites on Testbooru and it seems to work, but it might be more scuffed with 50k. It'll print some messages to the console while running.
I add this script in this program but how i can run this script?