From 1339c49dc5301ea7fb05b47b7adbeb82f851c038 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Wed, 29 Jan 2025 10:50:27 -0700 Subject: [PATCH] Temporarily disable full size image search The reliance on non-mobile user agents breaks the full size image search config option, leading to empty image search result pages --- app/utils/search.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/utils/search.py b/app/utils/search.py index ed3b0f6..0f2d7fe 100644 --- a/app/utils/search.py +++ b/app/utils/search.py @@ -147,12 +147,13 @@ class Search: # force mobile search when view image is true and # the request is not already made by a mobile - view_image = ('tbm=isch' in full_query - and self.config.view_image - and not g.user_request.mobile) + # FIXME: Broken since the user agent changes as of 16 Jan 2025 + # view_image = ('tbm=isch' in full_query + # and self.config.view_image + # and not g.user_request.mobile) get_body = g.user_request.send(query=full_query, - force_mobile=view_image, + force_mobile=self.config.view_image, user_agent=self.user_agent) # Produce cleanable html soup from response @@ -160,8 +161,9 @@ class Search: html_soup = bsoup(get_body_safed, 'html.parser') # Replace current soup if view_image is active - if view_image: - html_soup = content_filter.view_image(html_soup) + # FIXME: Broken since the user agent changes as of 16 Jan 2025 + # if view_image: + # html_soup = content_filter.view_image(html_soup) # Indicate whether or not a Tor connection is active if g.user_request.tor_valid: