summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2026-07-15 18:08:27 +0200
committerBnyro <bnyro@tutanota.com>2026-07-16 15:50:58 +0200
commitb72a87676f119c691e7721b22b5fdc1b32c427e3 (patch)
treea22045977829b059f844409d337ab8570546ebd0 /searx
parentf2432e33d6e3778cb0e976d602bb259d60081d64 (diff)
[fix] public domain image archive: crashes upon response
The code used here has always been "bad" because `about` shouldn't be used as data source, but the engine probably broke when type checks / dataclasses for the about parameter in engines has been added with <https://github.com/searxng/searxng/pull/6258>. Error log: ``` WARNING searx.engines.public domain im: ErrorContext('searx/engines/public_domain_image_archive.py', 143, '\'url\': _clean_url(f"{about[\'website\']}/images/{result[\'objectID\']}"),', 'TypeError', None, ("'EngineAbout' object is not subscriptable",)) False ERROR searx.engines.public domain im: exception : 'EngineAbout' object is not subscriptable Traceback (most recent call last): File "/home/bnyro/Projects/searxng/searx/search/processors/online.py", line 253, in search search_results = self._search_basic(query, params) File "/home/bnyro/Projects/searxng/searx/search/processors/online.py", line 239, in _search_basic return self.engine.response(response) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ File "/home/bnyro/Projects/searxng/searx/engines/public_domain_image_archive.py", line 143, in response 'url': _clean_url(f"{about['website']}/images/{result['objectID']}"), ~~~~~^^^^^^^^^^^ TypeError: 'EngineAbout' object is not subscriptable ```
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/public_domain_image_archive.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/engines/public_domain_image_archive.py b/searx/engines/public_domain_image_archive.py
index 0a528ef15..587fa4f1f 100644
--- a/searx/engines/public_domain_image_archive.py
+++ b/searx/engines/public_domain_image_archive.py
@@ -140,7 +140,7 @@ def response(resp):
results.append(
{
'template': 'images.html',
- 'url': _clean_url(f"{about['website']}/images/{result['objectID']}"),
+ 'url': _clean_url(f"{pdia_base_url}/images/{result['objectID']}"),
'img_src': _clean_url(base_image_url),
'thumbnail_src': _clean_url(base_image_url + THUMBNAIL_SUFFIX),
'title': f"{result['title'].strip()} by {result['artist']} {result.get('displayYear', '')}",