From 296aab6ad5ce612b2e44b3eafb7454a58850aca4 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Fri, 26 Jun 2020 12:38:14 +0200 Subject: [qutebrowser] Block youtube adds --- qutebrowser/.config/qutebrowser/config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'qutebrowser') 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', '{}'] -- cgit v1.2.3