Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arskiy/a5961a921eac6672aea27337d0afc21c to your computer and use it in GitHub Desktop.
Save arskiy/a5961a921eac6672aea27337d0afc21c to your computer and use it in GitHub Desktop.
credits: @tadeokondrak
--- a/qutebrowser/components/adblock.py
+++ b/qutebrowser/components/adblock.py
@@ -119,6 +119,14 @@ class HostBlocker:
return False
host = request_url.host()
+ path = request_url.path()
+ query = request_url.query()
+
+ if (host == 'www.youtube.com' and
+ ((path == '/get_video_info' and '&adformat=' in query) or
+ (path == '/get_midroll_info'))):
+ return True
+
return ((host in self._blocked_hosts or
host in self._config_blocked_hosts) and
not _is_whitelisted_url(request_url))
@arskiy
Copy link
Author

arskiy commented Jul 13, 2019

if you installed qtb from pip like most ppl, the file you'll have to patch will be located in /usr/lib/python3.X/site-packages/qutebrowser/components/adblock.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment