Skip to content

Instantly share code, notes, and snippets.

@DevelopKim
Last active October 27, 2023 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DevelopKim/f346633df84c9e2ddb9f565ffa111a85 to your computer and use it in GitHub Desktop.
Save DevelopKim/f346633df84c9e2ddb9f565ffa111a85 to your computer and use it in GitHub Desktop.
유튜브 나중에 볼 영상 일괄 삭제
let btns = document.querySelectorAll('#button.style-scope > yt-icon.style-scope.ytd-menu-renderer');
//get three buttons
let itemCount = 1;
//for counting
setInterval(function(){
btns[itemCount].click();
let removeBtn = document.querySelectorAll('#items > ytd-menu-service-item-renderer:nth-child(3) > tp-yt-paper-item')[0]
removeBtn.click();
//remove at list
itemCount+=1
}, 1000);
@DevelopKim
Copy link
Author

DevelopKim commented Oct 27, 2023

유튜브의 '좋아요 표시한 동영상' 의 경우 코드 일부만 수정 하면 같은 방식으로 동작 합니다.
8번 라인이 삭제 버튼을 지정하는 것인데 '좋아요 표시한 동영상' 에서는 순서가 다릅니다.
기존 nth-child(3)nth-child(6) 으로 변경 하면 됩니다.

 let removeBtn = document.querySelectorAll('#items > ytd-menu-service-item-renderer:nth-child(6) > tp-yt-paper-item')[0]

전체 코드 입니다.

let btns = document.querySelectorAll('#button.style-scope > yt-icon.style-scope.ytd-menu-renderer');
//get three buttons
let itemCount = 1;
//for counting

setInterval(function(){
    btns[itemCount].click();
    let removeBtn = document.querySelectorAll('#items > ytd-menu-service-item-renderer:nth-child(6) > tp-yt-paper-item')[0]
    removeBtn.click();
    //remove at list 
    itemCount+=1
}, 1000);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment