-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathyoutube-unsubscriber.js
72 lines (39 loc) · 1.66 KB
/
youtube-unsubscriber.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
var i = 0;
var myVar = setInterval(myTimer, 3000);
function myTimer() {
var els = document.getElementById("grid-container").getElementsByClassName("ytd-expanded-shelf-contents-renderer");
if (i < els.length) {
els[i].querySelector(".ytd-subscribe-button-renderer").click();
setTimeout(function() {
var i = 0;
var myVar = setInterval(myTimer, 3000);
function myTimer() {
var els = document.getElementById("grid-container").getElementsByClassName("ytd-expanded-shelf-contents-renderer");
if (i < els.length) {
els[i].querySelector("[aria-label^='Unsubscribe from']").click();
setTimeout(function() {
var confirmButton = document.getElementById("confirm-button");
if (confirmButton) {
var button = confirmButton.querySelector("yt-button-shape button");
if (button) {
button.click();
}
}
}, 2000);
setTimeout(function() {
els[i].parentNode.removeChild(els[i]);
}, 2000);
}
i++;
console.log(i + " Channels Unsubscribed\n");
console.log(els.length + " remaining");
}
}, 2000);
setTimeout(function() {
els[i].parentNode.removeChild(els[i]);
}, 2000);
}
i++;
console.log(i + " Channels Unsubscribed\n");
console.log(els.length + " remaining");
}