-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.js
82 lines (76 loc) · 3.64 KB
/
main.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
73
74
75
76
77
78
79
80
81
82
// ==UserScript==
// @name I'm not interested in this YouTube video!
// @namespace http://www.iamnotinterestedinthisyoutubevideo.com
// @version 1.1
// @description I'm not interested in this YouTube video!
// @match *://www.youtube.com/*
// @run-at document-end
// @require https://update.greasyfork.org/scripts/487311/1327382/My%20Trusted-Types%20Helper.js
// @require https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// ==/UserScript==
(function() {
'use strict';
if (/youtube\.com\/?$/.test(location.href)) {
console.log("Youtube home page detected!");
setInterval((function () {
let cells = $("ytd-rich-item-renderer.ytd-rich-grid-renderer.style-scope:not(.fucked)");
cells.each(function () {
let cell = $(this);
let temp = cell.find("ytd-thumbnail");
temp.hover(function (e) {
if (e.ctrlKey) {
$(this).closest("ytd-rich-item-renderer").find("button.style-scope.yt-icon-button").click();
setTimeout(function () {
$("yt-formatted-string:contains('Not interested')").click();
}, 50);
}
else if (e.altKey) {
$(this).closest("ytd-rich-item-renderer").find("button.style-scope.yt-icon-button").click();
setTimeout(function () {
$(`yt-formatted-string:contains("Don't recommend channel")`).click();
}, 50);
}
});
});
cells.addClass("fucked");
let shorts = $("ytd-rich-item-renderer.ytd-rich-shelf-renderer.style-scope:not(.fucked)");
shorts.each(function () {
let cell = $(this);
let temp = cell.find("ytm-shorts-lockup-view-model");
temp.hover(function (e) {
if (e.ctrlKey || e.altKey) {
$(this).closest("ytd-rich-item-renderer").find("button.yt-spec-button-shape-next").click();
setTimeout(function () {
$("span.yt-core-attributed-string:visible:contains('Not interested')").click();
}, 50);
}
});
});
shorts.addClass("fucked");
}), 2000);
}
if (/youtube\.com\/watch/.test(location.href)) {
setInterval((function () {
let cells = $("ytd-compact-video-renderer.style-scope:not(.fucked)");
cells.each(function () {
let cell = $(this);
let temp = cell.find("ytd-thumbnail");
temp.hover(function (e) {
if (e.ctrlKey) {
$(this).closest("ytd-compact-video-renderer").find("button.style-scope.yt-icon-button").click();
setTimeout(function () {
$("yt-formatted-string:contains('Not interested')").click();
}, 50);
}
else if (e.altKey) {
$(this).closest("ytd-compact-video-renderer").find("button.style-scope.yt-icon-button").click();
setTimeout(function () {
$(`yt-formatted-string:contains("Don't recommend channel")`).click();
}, 50);
}
});
});
cells.addClass("fucked");
}), 2000);
}
})();