Only remove G links in footer
Links that were directed at G domains were previously removed universally, when really they only needed to be removed from the footer to reduce possible confusion caused by mixed Whoogle and G links. Fixes #656main
parent
69f845a047
commit
f7e3650728
|
@ -349,7 +349,12 @@ class Filter:
|
||||||
if any(url in link['href'] for url in unsupported_g_pages):
|
if any(url in link['href'] for url in unsupported_g_pages):
|
||||||
# FIXME: The "Shopping" tab requires further filtering (see #136)
|
# FIXME: The "Shopping" tab requires further filtering (see #136)
|
||||||
# Temporarily removing all links to that tab for now.
|
# Temporarily removing all links to that tab for now.
|
||||||
|
parent = link.parent
|
||||||
|
while parent:
|
||||||
|
p_cls = parent.attrs.get('class') or []
|
||||||
|
if parent.name == 'footer' or f'{GClasses.footer}' in p_cls:
|
||||||
link.decompose()
|
link.decompose()
|
||||||
|
parent = parent.parent
|
||||||
return
|
return
|
||||||
|
|
||||||
# Replace href with only the intended destination (no "utm" type tags)
|
# Replace href with only the intended destination (no "utm" type tags)
|
||||||
|
|
|
@ -11,6 +11,7 @@ class GClasses(Enum):
|
||||||
"""
|
"""
|
||||||
main_tbm_tab = 'KP7LCb'
|
main_tbm_tab = 'KP7LCb'
|
||||||
images_tbm_tab = 'n692Zd'
|
images_tbm_tab = 'n692Zd'
|
||||||
|
footer = 'TuS8Ad'
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.value
|
return self.value
|
||||||
|
|
Loading…
Reference in New Issue