1
0
mirror of https://github.com/searx/searx synced 2024-12-03 07:31:22 +01:00
searx/searx
Alexandre Flament 3863f5a83f [enh] google engine: supports "default language"
Same behaviour behaviour than Whoogle [1].  Only the google engine with the
"Default language" choice "(all)"" is changed by this patch.

When searching for a locate place, the result are in the expect language,
without missing results [2]:

  > When a language is not specified, the language interpretation is left up to
  > Google to decide how the search results should be delivered.

The query parameters are copied from Whoogle.  With the ``all`` language:

- add parameter ``source=lnt``
- don't use parameter ``lr``
- don't add a ``Accept-Language`` HTTP header.

The new signature of function ``get_lang_info()`` is:

    lang_info = get_lang_info(params, lang_list, custom_aliases, supported_any_language)

Argument ``supported_any_language`` is True for google.py and False for the other
google engines.  With this patch the function now returns:

- query parameters: ``lang_info['params']``
- HTTP headers: ``lang_info['headers']``
- and as before this patch:
  - ``lang_info['subdomain']``
  - ``lang_info['country']``
  - ``lang_info['language']``

[1] https://github.com/benbusby/whoogle-search
[2] https://github.com/benbusby/whoogle-search/releases/tag/v0.5.4
2021-07-03 16:53:31 +02:00
..
answerers [fix] answers: don't crash when the query is an empty string 2021-03-01 10:52:39 +01:00
data Update searx.data - update_ahmia_blacklist.py 2021-07-03 15:31:09 +02:00
engines [enh] google engine: supports "default language" 2021-07-03 16:53:31 +02:00
metrology [enh] replace requests by httpx 2021-05-03 21:39:37 +02:00
network [mod] searx.network.client: the same configuration reuses the same ssl.SSLContext 2021-05-06 22:52:30 +02:00
plugins Add hostname_replace plugin 2021-04-29 21:48:05 +02:00
search [httpx] replace searx.poolrequests by searx.network 2021-05-03 21:39:54 +02:00
shared [fix] checker: don't run the checker when uwsgi is not properly configured 2021-01-13 14:07:39 +01:00
static Merge pull request #2675 from dalf/oscar-images 2021-04-21 15:31:12 +02:00
templates [fix] correct kv template formatting and remove internal data 2021-05-30 19:20:46 +02:00
translations [enh] update translations from transifex 2021-03-27 19:10:54 +01:00
__init__.py [mod] settings.yml: move brand settings to a dedicated section 2021-01-11 22:59:52 +01:00
autocomplete.py [httpx] replace searx.poolrequests by searx.network 2021-05-03 21:39:54 +02:00
exceptions.py [enh] add raise_for_httperror 2020-12-11 14:37:08 +01:00
external_bang.py [mod] add utils/fetch_external_bangs.py 2021-02-24 18:48:36 +01:00
external_urls.py [mod] add external_urls.json and wikidata_units.json 2020-10-28 08:09:25 +01:00
languages.py Update searx.data - update_languages.py 2021-03-05 10:56:46 +00:00
preferences.py [fix] default_doi_resolver in preferences 2021-04-04 13:36:33 +02:00
query.py [enh] autocomplete refactoring, autocomplete on external bangs 2021-03-01 19:12:32 +01:00
results.py [enh] add ability to send engine data to subsequent requests 2021-03-06 12:12:35 +01:00
settings_loader.py [fix] settings_loader.py - use update_dict only for mapping types 2021-04-05 16:33:48 +02:00
settings_robot.yml Use oadoi.org as default_doi_resolver 2021-04-29 22:43:52 +02:00
settings.yml Add json_engine configuration for ManKier 2021-05-31 13:54:50 -05:00
testing.py [httpx] replace searx.poolrequests by searx.network 2021-05-03 21:39:54 +02:00
utils.py [enh] replace requests by httpx 2021-05-03 21:39:37 +02:00
version.py [enh] release v1.0.0 2021-03-27 20:30:08 +01:00
webadapter.py [enh] add ability to send engine data to subsequent requests 2021-03-06 12:12:35 +01:00
webapp.py [mod] disable /stats page by default to prevent potential data leak 2021-05-13 22:21:46 +02:00
webutils.py Updated webutils.highlight_content to ignore double-quotes when highlighting query parts 2021-02-08 23:58:54 -05:00