4 Commits

Author SHA1 Message Date
Markus Heiser
ee6d4f322f [mod] engine: reuters - REST-API for Reuter's thumbnail, height:80
The size of the full-size images from ``thumbnail.url`` is usually several
MB. By reducing the full-size image to 80 pixels, the data size for a thumb is
reduced from MB to a few KB.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-10-18 14:43:35 +02:00
Bnyro
3725aef6f3 [fix] reuters: crash on empty results pages & date parsing
1. On empty result list, return empty EngineResults (#5330)

2. Use ``dateutil.parser`` to avoid ``ValueError``:

    ERROR   searx.engines.reuters : exception : Invalid isoformat string: '2022-06-08T16:07:54Z'
      File "searx/engines/reuters.py", line 91, in response
        publishedDate=datetime.fromisoformat(result["display_time"]),
    ValueError: Invalid isoformat string: '2022-06-08T16:07:54Z'

Closes: https://github.com/searxng/searxng/issues/5330
Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2025-10-18 14:43:35 +02:00
Ishbir Singh
b606103352
[fix] reuters: published date not parsed correctly in some cases
FIxes publishedDate format in reuters engine to encompass ISO 8601 times both with and without milliseconds.
Why is this change important?

Previously, the engine would sometimes fail saying:

2025-08-12 21:13:23,091 ERROR:searx.engines.reuters: exception : time data '2024-04-15T19:08:30.833Z' does not match format '%Y-%m-%dT%H:%M:%SZ'

Traceback (most recent call last):

...
  File "/usr/local/searxng/searx/engines/reuters.py", line 87, in response

    publishedDate=datetime.strptime(result["display_time"], "%Y-%m-%dT%H:%M:%SZ"),

                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...

Note that most queries seem to work with Reuters, but there are some results that have the additional milliseconds and fail. Regardless, the change is backwards compatible as both the formats (with and without the ms) should now parse correctly.
2025-08-16 15:50:38 +00:00
Bnyro
9ffa9fb730 [feat] engines: add reuters news engine 2025-03-30 13:56:09 +02:00