Last active
December 11, 2023 02:41
-
-
Save Starsign68/cb0ac5038c40ac5ac56a9e8f47c36b09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
/// Skip.js | |
/// alias skip.js | |
globalThis["skip"] = () => { | |
var g = document.querySelector("#movie_player"); | |
var m = document.querySelector("#movie_player > div.video-ads.ytp-ad-module"); | |
var a = g.querySelector("button.ytp-ad-skip-button"); | |
var x = document.querySelector("span.ytp-ad-skip-button-icon-modern"); | |
if (a) { | |
a.click(), g.classList.add("not-interested"); | |
} else { | |
if (g.querySelector(".ytp-ad-player-overlay")) { | |
if (Number.isFinite(m.duration)) { | |
(m.currentTime = m.duration - 0.5), m.paused && g.playVideo(), setTimeout(skip, 1000); | |
} else { | |
setTimeout(skip, 100); | |
} | |
} else { | |
g.classList.add("not-interested"), g.classList.remove("ytp-ad-overlay-open"); | |
} | |
} | |
document.querySelector("span.ytp-ad-skip-button-icon-modern").click(); | |
x.click(); | |
}; | |
skip(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment