Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3718

I'm trying to delete all of my duplicates from my youtube Playlist but keep getting an error after a few seconds of it working,is the command wrong

$
0
0

I'm trying to delete all of my duplicates from my youtube Playlist but keep getting an error after a few seconds of it working,is the command wrong. If someone could fix my command so that i also don't have to scroll down everytime for it to load more so it scrolls down after it finds everything than loads the rest of the playlist and continues? That would be a hugh help!

heres the command

function sleep(ms) {    return new Promise(resolve => setTimeout(resolve, ms));}function $$(selector, context = document.documentElement) {    return [...context?.querySelectorAll?.(selector) ?? []]};async function removeduplicates() {    let titles = $$("#primary a#video-title")        .filter((i, j, k) =>             k.findIndex(k =>                k.href.includes(Object.fromEntries(new URLSearchParams(i.href))['https://www.youtube.com/watch?v'])) !== j);    for (let i = 0; i < titles.length; i++) {        titles[i].focus();        titles[i].closest("#contents > *").querySelector('button[aria-label="Action menu"]').click();        await sleep(100);        var things = document.evaluate('//span[contains(text(),"Remove from")]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);        await sleep(300);        for (var j = 0; j < things.snapshotLength; j++) {            things.snapshotItem(j).click();        }        console.log(titles[i].innerText);    }}removeduplicates();

and here is the error

The resource https://i.ytimg.com/generate_204 was preloaded using linkpreload but not used within a few seconds from the window's loadevent. Please make sure it has an appropriate as value and it ispreloaded intentionally.

tried to make it able to scroll down after it finds all the duplicates songs in my Youtube Playlist than loads the rest of the playlist and continuesedit: now its giving me this error DevTools failed to load source map: Could not load content for https://www.youtube.com/s/desktop/6ca9d352/jsbin/web-animations-next-lite.min.vflset/web-animations-next-lite.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE


Viewing all articles
Browse latest Browse all 3718

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>