Expand removal of unsupported G pages

The images page still had a number of pages linked that forwarded to
non-Whoogle pages.

Also fixed footer styling on image results page.
This commit is contained in:
Ben Busby 2022-02-07 09:45:33 -07:00
parent f38ada589e
commit 82f58778c0
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1
2 changed files with 16 additions and 3 deletions

View File

@ -13,6 +13,14 @@ from urllib.parse import parse_qs
import os import os
minimal_mode_sections = ['Top stories', 'Images', 'People also ask'] minimal_mode_sections = ['Top stories', 'Images', 'People also ask']
unsupported_g_pages = [
'support.google.com',
'accounts.google.com',
'google.com/preferences',
'google.com/intl',
'advanced_search',
'tbm=shop'
]
def extract_q(q_str: str, href: str) -> str: def extract_q(q_str: str, href: str) -> str:
@ -315,14 +323,15 @@ class Filter:
None (the tag is updated directly) None (the tag is updated directly)
""" """
# Replace href with only the intended destination (no "utm" type tags) # Remove any elements that direct to unsupported Google pages
href = link['href'].replace('https://www.google.com', '') if any(url in link['href'] for url in unsupported_g_pages):
if 'advanced_search' in href or 'tbm=shop' in href:
# 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.
link.decompose() link.decompose()
return return
# Replace href with only the intended destination (no "utm" type tags)
href = link['href'].replace('https://www.google.com', '')
result_link = urlparse.urlparse(href) result_link = urlparse.urlparse(href)
q = extract_q(result_link.query, href) q = extract_q(result_link.query, href)

View File

@ -53,6 +53,10 @@ details summary span {
padding-top: 0 !important; padding-top: 0 !important;
} }
.footer {
text-align: center;
}
@media (min-width: 801px) { @media (min-width: 801px) {
body { body {
min-width: 736px !important; min-width: 736px !important;