mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 13:49:26 +02:00
[fix] update_engine_traits.py: annas archive, bing-* and zlibrary engines
Github action Update data - update_engine_traits [1] had issues in annas archive, bing-* and zlibrary engines: ./manage pyenv.cmd python ./searxng_extra/update/update_engine_traits.py [1] https://github.com/searxng/searxng/actions/runs/12530827768/job/34953392587 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
05c82d3201
commit
af3f272b0b
3 changed files with 34 additions and 9 deletions
|
@ -192,8 +192,21 @@ def fetch_traits(engine_traits: EngineTraits):
|
|||
# pylint: disable=import-outside-toplevel
|
||||
|
||||
from searx.network import get # see https://github.com/searxng/searxng/issues/762
|
||||
from searx.utils import gen_useragent
|
||||
|
||||
resp = get("https://www.bing.com/account/general")
|
||||
headers = {
|
||||
"User-Agent": gen_useragent(),
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
|
||||
"Accept-Language": "en-US;q=0.5,en;q=0.3",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"DNT": "1",
|
||||
"Connection": "keep-alive",
|
||||
"Upgrade-Insecure-Requests": "1",
|
||||
"Sec-GPC": "1",
|
||||
"Cache-Control": "max-age=0",
|
||||
}
|
||||
|
||||
resp = get("https://www.bing.com/account/general", headers=headers)
|
||||
if not resp.ok: # type: ignore
|
||||
print("ERROR: response from bing is not OK.")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue