diff --git a/app/filter.py b/app/filter.py index 4a4856f..be9809b 100644 --- a/app/filter.py +++ b/app/filter.py @@ -47,6 +47,10 @@ def filter_link_args(query_link): return query_link +def has_ad_content(element): + return element == 'ad' or element == 'sponsoredⓘ' + + class Filter: def __init__(self, user_keys: dict, mobile=False, config=None): if config is None: @@ -132,7 +136,7 @@ class Filter: return for div in [_ for _ in self.main_divs.find_all('div', recursive=True)]: - has_ad = len([_ for _ in div.find_all('span', recursive=True) if 'ad' == _.text.lower()]) + has_ad = len([_ for _ in div.find_all('span', recursive=True) if has_ad_content(_.text.lower())]) _ = div.decompose() if has_ad else None def fix_question_section(self): diff --git a/app/static/js/controller.js b/app/static/js/controller.js index fef7731..95d917b 100644 --- a/app/static/js/controller.js +++ b/app/static/js/controller.js @@ -80,7 +80,7 @@ const loadConfig = event => { } let xhrPUT = new XMLHttpRequest(); - xhrPUT.open("PUT", "/config?name=" + config); + xhrPUT.open("PUT", "/config?name=" + config + ".conf"); xhrPUT.onload = function() { if (xhrPUT.readyState === 4 && xhrPUT.status !== 200) { alert("Error loading Whoogle config"); @@ -102,7 +102,7 @@ const saveConfig = event => { } let configForm = document.getElementById("config-form"); - configForm.action = '/config?name=' + config; + configForm.action = '/config?name=' + config + ".conf"; configForm.submit(); };