Поддръжка на The Movie Database

delete all from watchlist and favorites

2 отговора (на страница 1 от общо 1)

Jump to last post

or at lest let me mark the shows and then click delete/ Remove

// ==UserScript== // @name TMDB Auto Remover with Button in List Options (Fixed Load More) // @namespace http://tampermonkey.net/ // @version 1.2 // @description Adds a "Remove All" button inside list options and removes items, then clicks Load More properly // @match https://www.themoviedb.org/u/Kolex06/* // @grant none // ==/UserScript==

(function () { 'use strict';

const delay = ms => new Promise(res => setTimeout(res, ms));

// Function to remove items on the page
async function removeItems() {
    let removeButtons = document.querySelectorAll('a.account_list_action[data-remove="true"]');
    for (let btn of removeButtons) {
        btn.click();
        await delay(500); // Wait for the removal to process
    }
}

// Function to click the "Load More" button
async function loadMoreItems() {
    const loadMoreButton = document.querySelector('a.load_more');
    if (loadMoreButton) {
        loadMoreButton.click();
        console.log("🔄 Clicking Load More...");
        await delay(3000); // Wait for new items to load
        return true;
    }
    console.log("⚠️ No more 'Load More' button found.");
    return false;
}

// Function to start removing all items and loading more
async function processAllItems() {
    let hasMoreItems = true;
    while (hasMoreItems) {
        await removeItems();  // Remove visible items

        hasMoreItems = await loadMoreItems();  // Try loading more items

        if (hasMoreItems) {
            console.log("✨ Items removed, new items loaded.");
        } else {
            console.log("🎉 All items have been removed.");
        }
    }
}

// Add the "Remove All" button inside the list_option_wrapper
function addRemoveButton() {
    const listOptionWrapper = document.querySelector('.list_option_wrapper');
    if (!listOptionWrapper) return;

    const button = document.createElement('button');
    button.textContent = "Remove All Items";
    button.style.backgroundColor = "#ff4f4f";
    button.style.color = "#fff";
    button.style.padding = "8px 16px";
    button.style.fontSize = "14px";
    button.style.border = "none";
    button.style.cursor = "pointer";
    button.style.marginTop = "10px";
    button.style.borderRadius = "5px";
    button.addEventListener('click', () => {
        processAllItems();
    });

    listOptionWrapper.appendChild(button);
}

// Add the "Remove All" button when the page is loaded
window.addEventListener('load', () => {
    setTimeout(addRemoveButton, 2000); // Add button after the page loads
});

})();

Не можете да откриете филм или сериал? Влезте, за да го създадете.

Глобални

s фокусиране на лентата за търсене
p отваряне на меню "Профил"
esc затваряне на отворен прозорец
? отваряне на прозореца за клавишните комбинации

На страниците за медиите

b връщане назад
e към страницата за редактиране

На страниците за сезони

(стрелка надясно) към следващ сезон
(стрелка наляво) към предишния сезон

На страниците за епизоди

(стрелка надясно) към следващ епизод
(стрелка наляво) предишен епизод

На всички страници за изображения

a отваряне на прозорец за добавяне на изображение

На всички страници за редактиране

t меню за избор на език, на превода
ctrl+ s изпращане на форма

На страниците за дискусия

n създаване на нова дискусия
w статус на наблюдаване
p публична/лична
c затваряне/отваряне
a отваряне на действия
r отговаряне в дискусия
l към последния отговор
ctrl+ enter изпращане на вашето съобщение
(стрелка надясно) следваща страница
(стрелка наляво) предишна страница

Настройки

Искате ли да го оцените или добавите към списък?

Вход