r/qutebrowser • u/Danaykroid • Jul 05 '26
Youtube ad blocking problem
how do you implement youtube ad skip for qute. Because, when I tried to implement ad skipping using this script and it just skips the whole video how can I fix that the ad gets skipped pretty fast but the video is also done.
// ==UserScript==
// for more updated scripts, see: https://greasyfork.org/en/scripts/by-site/youtube.com
// u/nameAuto Skip YouTube Ads
// u/version1.1.0
// u/description Speed up and skip YouTube ads automatically
// u/authorjso8910 and others
// u/match*://*.youtube.com/*
// ==/UserScript==
document.addEventListener('load', () => {
const btn = document.querySelector('.videoAdUiSkipButton,.ytp-ad-skip-button-modern')
if (btn) {
btn.click()
}
const ad = [...document.querySelectorAll('.ad-showing')][0];
if (ad) {
document.querySelector('video').currentTime = 9999999999;
}
}, true);
1
u/sim590 Jul 10 '26
@Danaykroid: if you use the userscript
view_in_mpv, it will skip adds for you and launch the video in mpv. For better experience, I think that havingyt-dlpinstalled is recommended. Personally, I have a wrapper script forview_in_mpvwhich contains:My qutebrowser profile is defined in
~/dotfiles/config/mpv/mpv.confand contains:Of course, I assume you are using a UNIX-like system.
1
u/adcott Sep 19 '26 edited Oct 01 '26
If you are still strugging with this, I have just written something that works well:
Also kills midroll ads and removes sponsored links.
edits:
2026/09/28: removed redundant code (don't need to check for skip buttons that don't have a chance to appear)
2026/10/01: micro-optimisation