2026.02.18 22:00
조회 수 17 추천 수 0 댓글 0
| 첨부 '1' |
|
|---|
Shortcut
Prev이전 문서
Next다음 문서
Shortcut
Prev이전 문서
Next다음 문서
유튜브 댓글 컨텐츠 숨기기를 했더니 삭제가 안되더라구요 3번이나 시도하다가 포기하고
직접 콘솔로 삭제하기로 했습니다
아래는 PC 브라우저 F12 콘솔에 붙여넣으면 빠르게 댓글 단거 기록 다 삭제해줍니다
4000개 지우는데 20분밖에 안걸려요!!!
제미나이랑 20번정도 수정하면서 최종적으로 문제없다고 판단되는 상태까지 만든 코드입니다
필요하신분 가져가서 쓰세요!!!
↓https://myactivity.google.com/
/**
* 10개 지우고 무조건 20초 정지하는 코드
*/
async function strictBatchDelete() {
let totalDeleted = 0;
console.log("🚀 10개 삭제 후 20초 대기 모드 시작");
while (true) {
// 매번 버튼을 새로 찾습니다. (중복 클릭 방지)
let buttons = Array.from(document.querySelectorAll('button[aria-label*="삭제"], button[aria-label*="Delete"]'));
if (buttons.length === 0) {
console.log("🔄 버튼이 없네요. 아래로 스크롤해서 데이터를 가져옵니다.");
window.scrollTo(0, document.body.scrollHeight);
await new Promise(r => setTimeout(r, 3000));
buttons = Array.from(document.querySelectorAll('button[aria-label*="삭제"], button[aria-label*="Delete"]'));
if (buttons.length === 0) break;
}
// 10개만 골라서 작업
let targetBatch = buttons.slice(0, 10);
console.log(`📦 이번 뭉치(${targetBatch.length}개) 작업을 시작합니다.`);
for (const btn of targetBatch) {
try {
btn.click();
await new Promise(r => setTimeout(r, 600)); // 팝업 대기
const confirmBtn = document.querySelector('button[data-mdc-dialog-action="ok"], .VfPpkd-LgbsSe[data-mdc-dialog-action="delete"]');
if (confirmBtn) {
confirmBtn.click();
totalDeleted++;
console.log(`✅ ${totalDeleted}개 완료`);
await new Promise(r => setTimeout(r, 800)); // 서버 전송 대기
}
} catch (e) {
continue;
}
}
// 10개 세트 끝난 후 무조건 강제 휴식
console.log("🛑 10개 끝! 약속대로 20초 쉽니다. 건드리지 마세요.");
await new Promise(r => setTimeout(r, 20000));
console.log("🏃 다시 달립니다!");
}
console.log(`🏁 모든 작업이 끝났습니다. 총 ${totalDeleted}개 처리.`);
}
strictBatchDelete();