Files
searxng/searx/engines
Markus Heiser 744d96a16c [fix] startpage engine: language/region & time support & fix CAPTCHA
One reason for the often seen CAPTCHA of the startpage requests are the
incomplete requests SearXNG sends to startpage.com.  To avoid CAPTCHA we need to
send a well formed HTTP POST request with a cookie, we need to form a request
that is identical to the request build by startpage.com itself:

- in the cookie the **region** is selected
- in the POST arguments the **language** is selected

Based on the *engine_properties* boilerplate, SearXNG's startpage engine now
implements a `_fetch_engine_properties()` function to fetch regions & languages
from startpage.com.

This patch is a complete new implementation of the request() function, reversed
engineered from the startpage.com page.  The new implementation adds

- time-range support
- save-search support

to the startpage engine which has been missed in the past.

The locale code 'no_NO' from startpage does not exists and is mapped to nb-NO.
For reference see languages-subtag at iana [1], `no` is the macrolanguage::

     type: language
     Subtag: nb
     Description: Norwegian Bokmål
     Added: 2005-10-16
     Suppress-Script: Latn
     Macrolanguage: no

Additional hints:

- To fetch languages from startpage, this patch makes use of the
  EngineProperties implemented in 7bf0d46c

- Te get Startpage's locale & language, the function get_engine_locale from
  9ae409a is used.

[1] https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
[2] https://www.w3.org/International/questions/qa-choosing-language-tags#langsubtag

Closes: https://github.com/searxng/searxng/issues/1081
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-08-29 19:27:50 +02:00
..
2022-01-05 11:00:11 +01:00
2022-01-05 11:00:11 +01:00
2021-12-27 10:16:20 +01:00
2021-01-14 20:57:17 +01:00
2022-01-05 11:00:11 +01:00
2022-01-05 11:00:11 +01:00
2022-01-05 11:00:11 +01:00
2022-01-05 11:00:11 +01:00
2022-01-28 22:33:41 +01:00
2022-07-04 19:06:45 +02:00
2022-07-30 18:04:44 +02:00
2022-07-30 18:04:44 +02:00
2022-07-30 18:04:44 +02:00
2022-01-02 21:18:29 +01:00
2022-01-05 11:00:11 +01:00
2022-08-17 19:45:42 +07:00
2022-01-30 19:48:40 +01:00
2022-04-17 11:29:23 +02:00
2022-04-22 16:09:36 +02:00
2022-07-05 22:27:55 +02:00