diff options
author | Urbain Vaes <urbain@vaes.uk> | 2020-06-26 12:38:14 +0200 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2020-06-26 12:38:14 +0200 |
commit | 296aab6ad5ce612b2e44b3eafb7454a58850aca4 (patch) | |
tree | be47efce08dfdb233a91a3fbe78cc615e4d958b3 /qutebrowser | |
parent | 4912f8abda4ea22e3156c1e8fbed8f2025d60e6c (diff) |
[qutebrowser] Block youtube adds
Diffstat (limited to 'qutebrowser')
-rw-r--r-- | qutebrowser/.config/qutebrowser/config.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/qutebrowser/.config/qutebrowser/config.py b/qutebrowser/.config/qutebrowser/config.py index aa447b9..f1b72c7 100644 --- a/qutebrowser/.config/qutebrowser/config.py +++ b/qutebrowser/.config/qutebrowser/config.py @@ -2,6 +2,19 @@ # qute://help/configuring.html # qute://help/settings.html +from qutebrowser.api import interceptor + + +def filter_yt(info: interceptor.Request): + url = info.request_url + if (url.host() == 'www.youtube.com' + and url.path() == '/get_video_info' + and '&adformat=' in url.query()): + info.block() + + +interceptor.register(filter_yt) + c.content.images = True c.downloads.location.prompt = False c.editor.command = ['urxvt', '-e', 'nvim', '-f', '{}'] |