mirror of
https://github.com/Phantop/dotfiles
synced 2025-01-18 18:47:34 +00:00
Qute: config.py for YouTube ad block
This commit is contained in:
parent
566599adaa
commit
228099ac19
15
.config/qutebrowser/config.py
Normal file
15
.config/qutebrowser/config.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
config.load_autoconfig()
|
||||
|
||||
from qutebrowser.api import interceptor
|
||||
|
||||
# Youtube adblock
|
||||
def filter_yt(info: interceptor.Request):
|
||||
"""Block the given request if necessary."""
|
||||
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)
|
Loading…
Reference in a new issue