summaryrefslogtreecommitdiff
path: root/searx/engines/qwant.py
AgeCommit message (Collapse)Author
2024-10-03add get_embeded_stream_url to searx.utilsAustin-Olacsi
2024-09-15[fix] engine: qwant - detect captchaUrl and raise SearxEngineCaptchaExceptionMarkus
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>
2024-05-29[enh] add re-usable func to filter textAllen
2024-05-16[mod] simple theme: drop img_src from default resultsMarkus Heiser
The use of img_src AND thumbnail in the default results makes no sense (only a thumbnail is needed). In the current state this is rather confusing, because img_src is displayed like a thumbnail (small) and thumbnail is displayed like an image (large). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-03-11[mod] pylint all engines without PYLINT_SEARXNG_DISABLE_OPTIONMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-02-25[refactor] images: add resolution, image format and filesize fieldsBnyro
Co-authored-by: Markus Heiser <markus.heiser@darmarit.de>
2023-12-03[mod] add option max_page to bing, brave, qwant, startpage & mojeekMarkus Heiser
[1] https://github.com/searxng/searxng/issues/2982#issuecomment-1808975780 Reported-by: @Damaj301damaj-lol [1] Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-09-19[fix] engine qwant (web-lite) - ignore advertising addsMarkus Heiser
Closes: https://github.com/searxng/searxng/issues/2812 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-09-18[fix] spellingjazzzooo
2023-09-18[fix] engine - qwant delivers only 5 pages maximumMarkus Heiser
all qwant engines (incl qwant-lite) delivers only 5 pages maximum Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-09-18[fix] engine - qwant wrong error typejazzzooo
2023-09-17[fix] qwant: subsequent fix of commit d9dbcedebMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-09-17[feat] implementation of qwant lite for web searchMarkus Heiser
Related: https://github.com/searxng/searxng/issues/2719 Replace: https://github.com/searxng/searxng/pull/2748 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-03-24[mod] qwant: fetch engine traits (data_type: traits_v1)Markus Heiser
Implements a fetch_traits function for the Qwant engines. .. note:: Includes migration of the request methode from 'supported_languages' to 'traits' (EngineTraits) object! Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-08-14[mod] qwant - add safesearch optionMarkus Heiser
Closes: https://github.com/searxng/searxng/issues/1640 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-08-14[fix] qwant - API error::locale must be one ..Markus Heiser
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>
2022-08-14[mod] decouple qwant's categories from SearXNG's categoriesMarkus Heiser
By using new property `qwant_categ:` the category of qwant is no longer bound to the category of SearXNG. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-12-27[format.python] initial formatting of the python codeMarkus Heiser
This patch was generated by black [1]:: make format.python [1] https://github.com/psf/black Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-17[fix] Qwant search query stringTom
Search string: "!qwant time" Resulting request URL: https://api.qwant.com/v3/search/web?q=q=time&count=10&offset=0&device=desktop&safesearch=1&locale=en_US Notice the double "q=" Resulting request URL after fix: https://api.qwant.com/v3/search/web?q=time&count=10&offset=0&device=desktop&safesearch=1&locale=en_US
2021-10-14[fix] language param for qwantMrPaulBlack
2021-10-12[fix] qwant engine - only get results from categoriesNoémi Ványi
Reported-by: https://github.com/searx/searx/issues/3014 Cherry-picked: https://github.com/searx/searx/commit/3bcca43
2021-09-07[fix] drop useless pylint: disable=undefined-variableMarkus Heiser
Since 7b235a1 (see line 591) it is no longer needed to disable 'undefined-variable' for names defined in:: PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES Suggested-by: @dalf https://github.com/searxng/searxng/issues/102#issuecomment-914068609 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-24[fix] qwant engine - prevent API locale exception on lang 'all'Markus Heiser
Has been reported in [1], error message:: Error Error: searx.exceptions.SearxEngineAPIException Percentage: 0 Parameters: ('API error::locale must be a string,locale must be one of the following values: en_gb, en_ie, en_us, en_ca, en_in, en_my, en_au, en_nz, cy_gb, gd_gb, de_de, de_ch, de_at, fr_fr, br_fr, fr_be, fr_ch, fr_ca, fr_ad, fc_ca, ec_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_br, pt_pt, pt_ad, nl_be, nl_nl, pl_pl, zh_hk, zh_cn, fi_fi, bg_bg, et_ee, hu_hu, da_dk, nb_no, sv_se, ko_kr, th_th, cs_cz, ro_ro, el_gr',) File name: searx/engines/qwant.py:114 Function: response Code: raise SearxEngineAPIException('API error::' + msg) [1] https://github.com/searxng/searxng/issues/222 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-24[fix] qwant engine - prevent exception on date/time value is NoneMarkus Heiser
Has been reported in [1], error messages:: Error Error: ValueError Percentage: 0 Parameters: () File name: searx/engines/qwant.py:159 Function: response Code: pub_date = datetime.fromtimestamp(item['date'], None) Error Error: TypeError Percentage: 0 Parameters: ('an integer is required (got type NoneType)',) File name: searx/engines/qwant.py:196 Function: response Code: pub_date = datetime.fromtimestamp(item['date']) Fix timedelta from seconds to milliseconds [1], error message:: Error Error: TypeError Percentage: 0 Parameters: ('unsupported type for timedelta seconds component: NoneType',) File name: searx/engines/qwant.py:195 Function: response Code: length = timedelta(seconds=item['duration']) [1] https://github.com/searxng/searxng/issues/222 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-16[mod] qwant engine: fix typos / minor changeAlexandre Flament
minor modification of commit 628b5703f3aeeed117772696f83efb344d6f337e (no functionnal change)
2021-07-15[mod] improve video results of the qwant engineMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-07-14[fix] Qwant engines - implement API v3 and add 'quant videos'Markus Heiser
The implementation uses the Qwant API (https://api.qwant.com/v3). The API is undocumented but can be reverse engineered by reading the network log of https://www.qwant.com/ queries. This implementation is used by different qwant engines in the settings.yml:: - name: qwant categories: general ... - name: qwant news categories: news ... - name: qwant images categories: images ... - name: qwant videos categories: videos ... Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-05-02fix Qwant's fetch_languages functionMarc Abonce Seguin
2021-04-12[httpx] replace searx.poolrequests by searx.networkAlexandre Flament
settings.yml: * outgoing.networks: * can contains network definition * propertiers: enable_http, verify, http2, max_connections, max_keepalive_connections, keepalive_expiry, local_addresses, support_ipv4, support_ipv6, proxies, max_redirects, retries * retries: 0 by default, number of times searx retries to send the HTTP request (using different IP & proxy each time) * local_addresses can be "192.168.0.1/24" (it supports IPv6) * support_ipv4 & support_ipv6: both True by default see https://github.com/searx/searx/pull/1034 * each engine can define a "network" section: * either a full network description * either reference an existing network * all HTTP requests of engine use the same HTTP configuration (it was not the case before, see proxy configuration in master)
2021-02-01[mod] dynamically set language_support variableAlexandre Flament
The language_support variable is set to True by default, and set to False in only 5 engines. Except the documentation and the /config URL, this variable is not used. This commit remove the variable definition in the engines, and set value according to supported_languages length: False when the length is 0, True otherwise. Close #2485
2021-01-14[enh] engines: add about variableAlexandre Flament
move meta information from comment to the about variable so the preferences, the documentation can show these information
2020-12-11[enh] add raise_for_httperrorAlexandre Flament
check HTTP response: * detect some comme CAPTCHA challenge (no solving). In this case the engine is suspended for long a time. * otherwise raise HTTPError as before the check is done in poolrequests.py (was before in search.py). update qwant, wikipedia, wikidata to use raise_for_httperror instead of raise_for_status
2020-11-03[mod] pylint: minor code change to allow pylint globallyAlexandre Flament
This commit is only a step, it doesn't fix all the issues reported by pylint
2020-09-22add language names in qwant's fetch languages functionMarc Abonce Seguin
2020-09-10Drop Python 2 (1/n): remove unicode string and url_utilsDalf
2019-12-21[fix] add explicit useragent header to requests - closes #1459Adam Tauber
2019-01-07Revert "remove 'all' option from search languages"Noémi Ványi
This reverts commit 4d1770398a6af8902e75c0bd885781584d39e796.
2019-01-06[fix] check language aliases when setting search languageMarc Abonce Seguin
2018-08-13[fix] update qwant search urlAdam Tauber
thx to @dalf for the fix (#1365)
2018-03-27refactor engine's search language handlingMarc Abonce Seguin
Add match_language function in utils to match any user given language code with a list of engine's supported languages. Also add language_aliases dict on each engine to translate standard language codes into the custom codes used by the engine.
2017-12-06remove 'all' option from search languagesmarc
2017-05-15[mod] add/modify image fetching for bing_news, qwant and twitter enginesAlexandre Flament
2017-05-15[enh] py3 compatibilityAdam Tauber
2017-03-18make search language handling less strictmarc
languages.py can change, so users may query on a language that is not on the list anymore, even if it is still recognized by a few engines. also made no and nb the same because they seem to return the same, though most engines will only support one or the other.
2017-03-18add language support for qwantmarc
closes issue #863
2016-12-13[mod] fetch supported languages for several enginesmarc
utils/fetch_languages.py gets languages supported by each engine and generates engines_languages.json with each engine's supported language.
2016-12-13Add language support for more engines.marc
2016-12-10[fix] remove html tags from qwant resultsAdam Tauber
2015-06-02Removed the keywords from the settings in qwant engineCqoicebordel
2015-06-02RefactorCqoicebordel
Use only one engine for the four search from Qwant