Youtube button to delete a video from a playlist

Добавляет кнопку для удаления видео из плейлиста на ютубе

< Σχολιασμός για τον κώδικα Youtube button to delete a video from a playlist

Αναφορά: Κακός - ο κώδικας δεν λειτουργεί

§
Δημοσιεύτηκε: 10/07/2024

"Не удалось удалить видео. Пожалуйста, попробуйте снова." Doesn't work in my watch later playlist.

§
Δημοσιεύτηκε: 10/07/2024

It's best to use CSS selector to find the button instead of checking the text inside. I fixed it with this piece of code:

                await new Promise(resolve => setTimeout(resolve, 20)); // wait 20ms

                const removeButton = document.querySelector('#items > ytd-menu-service-item-renderer:nth-child(3) > tp-yt-paper-item');
                let removed = false;

                if (removeButton) {
                    removeButton.click();
                    removed = true;
                }

                if (!removed) {
                    alert('It was not possible to delete the video. Please try again.');
                }
art13Δημιουργός
§
Δημοσιεύτηκε: 16/07/2024
Επεξεργάστηκε: 16/07/2024

excellent, fixed) I'm not a programmer and didn't figure out how it works, I just fixed it in gptchat until it worked for me without any problems, and decided to share

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.