From 9dd33de91ab6869bed6e910dc09cbfa69d5f9ace Mon Sep 17 00:00:00 2001 From: rstefko Date: Sun, 28 Sep 2025 08:32:23 +0200 Subject: [PATCH 1/3] Seems to be working again with new UA --- app/utils/search.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/utils/search.py b/app/utils/search.py index 0f2d7fe..7795a9a 100644 --- a/app/utils/search.py +++ b/app/utils/search.py @@ -147,10 +147,9 @@ class Search: # force mobile search when view image is true and # the request is not already made by a 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) + 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=self.config.view_image, @@ -161,9 +160,8 @@ class Search: html_soup = bsoup(get_body_safed, 'html.parser') # Replace current soup if view_image is active - # FIXME: Broken since the user agent changes as of 16 Jan 2025 - # if view_image: - # html_soup = content_filter.view_image(html_soup) + 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: From 33cdaf390d41fde908b9cbcc372dd8ecc55b8c51 Mon Sep 17 00:00:00 2001 From: rstefko Date: Sun, 28 Sep 2025 08:45:43 +0200 Subject: [PATCH 2/3] Fixed too big images --- app/templates/imageresults.html | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/templates/imageresults.html b/app/templates/imageresults.html index cc3f6d6..1b7e429 100644 --- a/app/templates/imageresults.html +++ b/app/templates/imageresults.html @@ -161,7 +161,6 @@ .e3goi { vertical-align: top; padding: 0; - height: 180px; } .GpQGbf { margin: auto; @@ -210,8 +209,6 @@ text-align: center; } .RAyV4b { - width: 162px; - height: 140px; line-height: 140px; overflow: "hidden"; text-align: center; @@ -220,8 +217,6 @@ text-align: center; margin: auto; vertical-align: middle; - width: 100%; - height: 100%; object-fit: contain; } .Tor4Ec { From ca214cb563f6cee92d1158755741605952ad38b1 Mon Sep 17 00:00:00 2001 From: rstefko Date: Sun, 28 Sep 2025 08:46:18 +0200 Subject: [PATCH 3/3] Allow view_image on mobile too, to be able to see origin --- app/utils/search.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/utils/search.py b/app/utils/search.py index 7795a9a..b6833b1 100644 --- a/app/utils/search.py +++ b/app/utils/search.py @@ -148,8 +148,7 @@ 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) + and self.config.view_image) get_body = g.user_request.send(query=full_query, force_mobile=self.config.view_image,