Last active
July 20, 2024 20:04
-
-
Save alok-mishra/405963a24599b16280f9a535da89133b to your computer and use it in GitHub Desktop.
Remove all items from Trakt collection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Removes all items from a page of the Trakt collection | |
// Run script from console of user's collection page | |
// Must be run on each page | |
$(".posters .grid-item").each(function() { | |
actionWatch($(this).closest('.grid-item'), 'collect', true) | |
}) |
@EverAndy, this works
Thank you!
The solutions worked fine until very recently. Trakt throwing up "Doh!" errors when trying to run this.
The solutions worked fine until very recently. Trakt throwing up "Doh!" errors when trying to run this.
I confirm that the server responds with a Too many requests
error. Due to this, I wrote the following script to clear my collection page by page. 32 pages in my case. Have fun.
function clearCollect(time = 2000) {
var i = 0, items = $(".grid-item");
console.log(`Start remove ${items.length} items`);
var interval = setInterval(() => {
if (i < items.length) {
let item = $(items[i++]);
actionWatch(item, "collect", true);
console.log(`Remove item ${i - 1}`);
} else clearInterval(interval);
}, time);
}
clearCollect();
@Clndl Your version works perfectly with the new rate limiting. You can decrease the interval to 1500ms without hitting the limit though.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a bookmark with the following saved as url. Makes it much easier to just select the bookmark once it switches pages. Following reconman suggestion: