summaryrefslogtreecommitdiff
path: root/searx/engines/photon.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-08-12 18:37:09 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2022-08-14 10:36:14 +0200
commit6579d6d5585a0ce58aaf223f7b1767ed69a0e428 (patch)
treea687af9fba208704cdb9f16db84ffe924c5d649b /searx/engines/photon.py
parent9ae409a05a0980ae70590303a83d983011831a80 (diff)
downloadsearxng-6579d6d5585a0ce58aaf223f7b1767ed69a0e428.tar.gz
searxng-6579d6d5585a0ce58aaf223f7b1767ed69a0e428.zip
[fix] qwant - API error::locale must be one ..
The request function should not request a language (aka locale) that is not supported by qwant. Select a locale like zh-TW ends in qwant's API error: ERROR searx.engines.qwant news: exception : \ API error::locale must be one of the following values: \ en_gb, en_ie, en_us, en_ca, en_my, en_au, en_nz, de_de, de_ch, de_at, fr_fr, \ fr_be, fr_ch, fr_ca, fr_ad, fc_ca, co_fr, es_es, es_ar, es_cl, es_co, es_mx, \ es_pe, es_ad, ca_es, ca_ad, ca_fr, eu_es, eu_fr, it_it, it_ch, pt_pt, pt_ad, \ nl_be, nl_nl The existing searx.utils.match_language function is unsuitable for this purpose, it is replaced by function searx.locales.get_engine_locale that is based on the methods from the babel package. The quant's _fetch_supported_languages function has been revised to filter out languages 8aka locales) not supported by qwant. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/engines/photon.py')
0 files changed, 0 insertions, 0 deletions