add Cloudflare AI Gateway engine
add settings for Cloudflare AI Gateway engine
set utf8 encode for data, fix non english char cause 500 error
format json data
fixed indentation and config format error
fix line-length limitation in CI
reformatted code for CI
reformatted code for CI
limit system prompts to less 120 chars
cleanup unused variable & format code
In its previous implementation, the macro ``checkbox_onoff_reversed`` always
created an ``aria-labelledby`` attribute, even if there was no descriptive tag
with the generated ID (used as the value of the ``aria-labelledby``).
Before this patch, the Nu-HTML-Checker [1] reported 255 issues of this type::
The aria-labelledby attribute must point to an element in the same document. (255)
[1] https://validator.w3.org/nu/
Signed-off-by: Markus <markus@venom.fritz.box>
The ``aria-labelledby`` [1] attribute identifies the element that labels the
element it is applied to. The templates ``infinite_scroll.html`` and
``search_on_category_select.html`` define a ``aria-labelledby`` at the <input>
tag but miss the id in the <div> with the description.
[1] https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby
Signed-off-by: Markus <markus@venom.fritz.box>
The restriction of shell scripts to certain distributions is only required for
certain actions such as the installation of a SearXNG instance. The maintenance
scripts and build processes were previously also restricted to these specific
distributions. With this patch, the build processes (such as the build of
online documentation) can now also be executed on all Linux distributions.
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
So far a CAPTCHA was not recognized in the response of the qwant engine and a
SearxEngineAPIException was raised by mistake. With this patch a CAPTCHA
redirect is recognized and the correct SearxEngineCaptchaException is raised.
Closes: https://github.com/searxng/searxng/issues/3806
Signed-off-by: Markus <markus@venom.fritz.box>
This patch fixes a bug reported by CI "Fetch traits" [1] (brave) and improves
other fetch traits functions (google, annas_archive & radio_browser).
brave:
File "/home/runner/work/searxng/searxng/searx/engines/brave.py", line 434, in fetch_traits
sxng_tag = region_tag(babel.Locale.parse(ui_lang, sep='-'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/searxng/searxng/searx/locales.py", line 155, in region_tag
Error: raise ValueError('%s missed a territory')
google:
change ERROR message about unknow UI language to INFO message
radio_browser:
country_list contains duplicates that differ only in upper/lower case
annas_archive:
for better diff; sort the persistence of the traits
[1] https://github.com/searxng/searxng/actions/runs/10606312371/job/29433352518#step:6:41
Signed-off-by: Markus <markus@venom.fritz.box>
* [feat] engine: add right dao
* [enh] right dao engine: allow additional classes
Allow additional classes while parsing to prevent the engine from breaking in the future if additional classes are added to the elements.
Co-authored-by: Bnyro <bnyro@tutanota.com>
---------
Co-authored-by: Bnyro <bnyro@tutanota.com>
The user_agent attribute of the Flask request object is an instance of
the werkzeug.user_agent.UserAgent class.
This will fix the following error of the self_info plugin:
> ERROR:searx.plugins.self_info: Exception while calling post_search
> Traceback (most recent call last):
> File "searx/plugins/__init__.py", line 203, in call
> ret = getattr(plugin, plugin_type)(*args, **kwargs)
> File "searx/plugins/self_info.py", line 31, in post_search
> search.result_container.answers['user-agent'] = {'answer': gettext('Your user-agent is: ') + ua}
> TypeError: can only concatenate str (not "UserAgent") to str
We do not want to show the user-agent information from the duckduckgo
zero click info. This is the user-agent used by searxng and not the
user-agent used by the user.
This was already done for the IP address in:
0fb3f0e4ae
Changes made to tineye engine:
1. Importing logging if TYPE_CHECKING is enabled
2. Remove unecessary try-catch around json parsing the response, as this
masked the original error and had no immediate benefit
3. Improve error handling explicitely for status code 422 and 400
upfront, deferring json_parsing only for these status codes and
successful status codes
4. Unit test all new applicable changes to ensure compatability