Created
July 13, 2019 03:55
-
-
Save arskiy/a5961a921eac6672aea27337d0afc21c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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