9 Commits

Author SHA1 Message Date
Tommaso Colella
c57db45672 [fix] 360search: fix engine by adding cookie caching
Co-authored-by: Bnyro <bnyro@tutanota.com>
2025-12-29 15:26:07 +01:00
searxng-bot
9491b514c9 [data] update searx.data - update_engine_descriptions.py 2025-12-29 15:24:06 +01:00
Tommaso Colella
320c317719 [mod] settings.yml: set engines that require an api key to inactive by default 2025-12-29 15:20:43 +01:00
Tommaso Colella
abae17e6fc [mod] docs: better explanation for search api usage and format support (#5574) 2025-12-29 15:04:33 +01:00
Austin-Olacsi
3baf5c38fc [fix] bilibili engine: send referer header 2025-12-29 14:59:08 +01:00
searxng-bot
ce46f30739 [data] update searx.data - update_currencies.py 2025-12-29 13:48:16 +01:00
searxng-bot
65a95539f1 [data] update searx.data - update_ahmia_blacklist.py 2025-12-29 13:47:12 +01:00
searxng-bot
874dc3f5ea [data] update searx.data - update_firefox_version.py 2025-12-29 13:46:57 +01:00
searxng-bot
7941719371 [data] update searx.data - update_wikidata_units.py 2025-12-29 13:46:46 +01:00
10 changed files with 699 additions and 271 deletions

View File

@@ -124,14 +124,17 @@ engine is shown. Most of the options have a default value or even are optional.
``api_key`` : optional
In a few cases, using an API needs the use of a secret key. How to obtain them
is described in the file.
is described in the file. Engines that require an API key are set to
``inactive: true`` by default. To enable such an engine, provide the API key
and set ``inactive: false``.
``disabled`` : optional
To disable by default the engine, but not deleting it. It will allow the user
to manually activate it in the settings.
``inactive``: optional
Remove the engine from the settings (*disabled & removed*).
Remove the engine from the settings (*disabled & removed*). This defaults to ``true`` for engines
that require an API key, please see the ``api_key`` section if you want to enable such an engine.
``language`` : optional
If you want to use another language for a specific engine, you can define it

View File

@@ -4,15 +4,33 @@
Search API
==========
The search supports both ``GET`` and ``POST``.
SearXNG supports querying via a simple HTTP API.
Two endpoints, ``/`` and ``/search``, are supported for both GET and POST methods.
The GET method expects parameters as URL query parameters, while the POST method expects parameters as form data.
Furthermore, two endpoints ``/`` and ``/search`` are available for querying.
If you want to consume the results as JSON, CSV, or RSS, you need to set the
``format`` parameter accordingly. Supported formats are defined in ``settings.yml``, under the ``search`` section.
Requesting an unset format will return a 403 Forbidden error. Be aware that many public instances have these formats disabled.
Endpoints:
``GET /``
``GET /search``
``POST /``
``POST /search``
example cURL calls:
.. code-block:: bash
curl 'https://searx.example.org/search?q=searxng&format=json'
curl -X POST 'https://searx.example.org/search' -d 'q=searxng&format=csv'
curl -L -X POST -d 'q=searxng&format=json' 'https://searx.example.org/'
Parameters
==========

File diff suppressed because it is too large Load Diff

View File

@@ -345,6 +345,7 @@
"af": "Australiese dollar",
"ar": "دولار أسترالي",
"bg": "Австралийски долар",
"bn": "অস্ট্রেলীয় ডলার",
"ca": "dòlar australià",
"cs": "australský dolar",
"cy": "Doler Awstralia",
@@ -566,6 +567,7 @@
"fi": "Bangladeshin taka",
"fr": "taka",
"ga": "taka na Banglaidéise",
"gl": "taka",
"he": "טאקה",
"hr": "Bangladeška taka",
"hu": "bangladesi taka",
@@ -646,6 +648,7 @@
"fi": "Bahrainin dinaari",
"fr": "dinar bahreïnien",
"ga": "dinar Bhairéin",
"gl": "dinar de Bahrain",
"he": "דינר בחרייני",
"hr": "Bahreinski dinar",
"hu": "bahreini dinár",
@@ -969,7 +972,7 @@
"et": "Botswana pula",
"eu": "Pula",
"fi": "Pula",
"fr": "pula",
"fr": "Pula",
"ga": "pula na Botsuáine",
"gl": "Pula",
"he": "פולה",
@@ -1275,6 +1278,10 @@
"uk": "Чилійський песо",
"vi": "Peso Chile"
},
"CNH": {
"en": "renminbi (offshore)",
"es": "yuan offshore"
},
"CNY": {
"af": "Renminbi",
"ar": "رنمينبي",
@@ -1287,7 +1294,7 @@
"da": "Renminbi",
"de": "Renminbi",
"dv": "ރެންމިބީ",
"en": "renminbi",
"en": "CNY",
"eo": "Renminbio",
"es": "yuan chino",
"et": "Renminbi",
@@ -1331,7 +1338,7 @@
"cs": "Kolumbijské peso",
"da": "Colombiansk peso",
"de": "kolumbianischer Peso",
"en": "peso",
"en": "Colombian peso",
"eo": "kolombia peso",
"es": "peso",
"et": "Colombia peeso",
@@ -1415,7 +1422,7 @@
"cy": "peso (Ciwba)",
"da": "Cubanske pesos",
"de": "kubanischer Peso",
"en": "peso",
"en": "Cuban peso",
"eo": "kuba peso",
"es": "peso",
"fi": "Kuuban peso",
@@ -1461,6 +1468,7 @@
"fi": "Kap Verden escudo",
"fr": "escudo cap-verdien",
"ga": "escudo Rinn Verde",
"gl": "escudo caboverdiano",
"he": "אשקודו כף ורדי",
"hr": "Zelenortski eskudo",
"hu": "zöld-foki köztársasági escudo",
@@ -1809,7 +1817,7 @@
"bg": "евро",
"bn": "ইউরো",
"ca": "euro",
"cs": "Euro",
"cs": "euro",
"cy": "Ewro",
"da": "Euro",
"de": "Euro",
@@ -1958,7 +1966,7 @@
"lt": "svaras sterlingų",
"lv": "sterliņu mārciņa",
"ms": "paun sterling",
"nl": "pond sterling",
"nl": "Britse pond",
"oc": "liure esterlina",
"pa": "ਪਾਊਂਡ ਸਟਰਲਿੰਗ",
"pl": "funt szterling",
@@ -2029,7 +2037,7 @@
"eo": "ganaa cedio",
"es": "cedi",
"fi": "Cedi",
"fr": "cedi",
"fr": "Cedi",
"ga": "cedi",
"gl": "Cedi",
"he": "סדי גאני",
@@ -2068,7 +2076,7 @@
"es": "libra gibraltareña",
"et": "Gibraltari nael",
"fi": "Gibraltarin punta",
"fr": "livre de Gibraltar",
"fr": "Livre de Gibraltar",
"ga": "punt Ghiobráltar",
"gl": "Libra de Xibraltar",
"he": "לירה גיברלטרית",
@@ -3582,7 +3590,7 @@
"cy": "tögrög Mongolia",
"da": "Tugrik",
"de": "Tögrög",
"en": "tugrik",
"en": "Mongolian tögrög",
"eo": "mongola tugriko",
"es": "tugrik mongol",
"fi": "Mongolian tugrik",
@@ -3799,7 +3807,7 @@
"bg": "Мексиканско песо",
"ca": "peso mexicà",
"cs": "Mexické peso",
"cy": "peso (Mecsico)",
"cy": "peso",
"de": "Mexikanischer Peso",
"en": "peso",
"eo": "meksika peso",
@@ -3835,7 +3843,7 @@
"tr": "Meksika pesosu",
"tt": "Миксикә писысы",
"uk": "мексиканський песо",
"vi": "Peso México"
"vi": "peso"
},
"MXV": {
"de": "UNIDAD DE INVERSION",
@@ -3848,7 +3856,7 @@
"ar": "رينغيت ماليزي",
"bg": "Малайзийски рингит",
"ca": "ringgit",
"cs": "Malajsijský ringgit",
"cs": "malajsijský ringgit",
"cy": "ringgit Maleisia",
"de": "Ringgit",
"en": "Malaysian ringgit",
@@ -4669,7 +4677,7 @@
"eo": "rusa rublo",
"es": "rublo ruso",
"et": "Venemaa rubla",
"eu": "Errusiar errublo",
"eu": "errusiar errublo",
"fi": "Venäjän rupla",
"fr": "rouble russe",
"ga": "rúbal na Rúise",
@@ -4753,6 +4761,7 @@
"fi": "Saudi-Arabian rial",
"fr": "riyal saoudien",
"ga": "riyal na hAraibe Sádaí",
"gl": "riyal saudita",
"he": "ריאל סעודי",
"hr": "Saudijski rijal",
"hu": "szaúdi riál",
@@ -5415,6 +5424,7 @@
"oc": "dinar tunisian",
"pl": "Dinar tunezyjski",
"pt": "dinar tunisiano",
"ro": "dinar tunisian",
"ru": "тунисский динар",
"sk": "Tuniský dinár",
"sl": "tunizijski dinar",
@@ -5755,7 +5765,7 @@
"en": "US Dollar (Next day)"
},
"UYI": {
"en": "Uruguay peso en Unidades Indexadas"
"en": "Uruguay Peso en Unidades Indexadas"
},
"UYU": {
"af": "Uruguaanse Peso",
@@ -7026,6 +7036,7 @@
"birr etiopia": "ETB",
"birr etíope": "ETB",
"birr éthiopien": "ETB",
"birr éthiopienne": "ETB",
"birr habsyah": "ETB",
"birr na haetóipe": "ETB",
"birre da etiópia": "ETB",
@@ -7212,6 +7223,7 @@
"ceatsal": "GTQ",
"cebelitarık sterlini": "GIP",
"cedi": "GHS",
"cedi du ghana": "GHS",
"cedi ghana": "GHS",
"cedi ghanese": "GHS",
"centr afrika franko": "XAF",
@@ -7279,7 +7291,10 @@
"chilensk peso": "CLP",
"chilské peso": "CLP",
"chinese renminbi": "CNY",
"chinese yuan": "CNY",
"chinese yuan": [
"CNY",
"CNH"
],
"chinesischer renminbi": "CNY",
"ci$": "KYD",
"cibuti frangı": "DJF",
@@ -7289,6 +7304,7 @@
"clp": "CLP",
"clp$": "CLP",
"clps": "CLP",
"cnh": "CNH",
"cny": "CNY",
"co $": "COP",
"co$": "COP",
@@ -7529,7 +7545,6 @@
"203"
],
"cирійський фунт": "SYP",
"d.r.": "EGP",
"da": "DZD",
"dalase": "GMD",
"dalasi": "GMD",
@@ -8209,6 +8224,7 @@
"HKD",
"AUD"
],
"dollars barbados": "BBD",
"dom$": "DOP",
"dominga peso": "DOP",
"dominicaanse peso": "DOP",
@@ -8423,7 +8439,6 @@
"dólares canadenses": "CAD",
"dólares estadounidenses": "USD",
"dólares neozelandeses": "NZD",
"dr": "EGP",
"dram": "AMD",
"dram armean": "AMD",
"dram armenia": "AMD",
@@ -8451,7 +8466,6 @@
"džibučio frankas": "DJF",
"džibutski franak": "DJF",
"džibutský frank": "DJF",
"d£": "EGP",
"e": "SZL",
"e rupee": "INR",
"e.m.u. 6": "XBB",
@@ -8510,6 +8524,7 @@
"ermenistan dramı": "AMD",
"ern": "ERN",
"erreal brasildar": "BRL",
"errublo": "RUB",
"errublo errusiar": "RUB",
"errupia indiar": "INR",
"errupia indonesiar": "IDR",
@@ -10235,6 +10250,7 @@
"manat de turkmenistan": "TMT",
"manat de turkmenistán": "TMT",
"manat del turkmenistan": "TMT",
"manat di azerbeidjan": "AZN",
"manat do azerbaijão": "AZN",
"manat na hasarbaiseáine": "AZN",
"manat newydd tyrcmenestan": "TMT",
@@ -11253,7 +11269,10 @@
"rends": "ZAR",
"renmibi": "CNY",
"renminb": "CNY",
"renminbi": "CNY",
"renminbi": [
"CNH",
"CNY"
],
"renminbi cinese": "CNY",
"renminbi yuan": "CNY",
"renminbio": "CNY",
@@ -12770,10 +12789,14 @@
"yhdistyneiden arabiemiraattien dirhami": "AED",
"yhdysvaltain dollari": "USD",
"ytl": "TRY",
"yuan": "CNY",
"yuan": [
"CNH",
"CNY"
],
"yuan chinezesc": "CNY",
"yuan chino": "CNY",
"yuan cinese": "CNY",
"yuan offshore": "CNH",
"yuan renmimbi": "CNY",
"yuan renminbi": "CNY",
"yuan rmb": "CNY",
@@ -12974,7 +12997,8 @@
"£s": "SYP",
"¥": [
"JPY",
"CNY"
"CNY",
"CNH"
],
"đài tệ": "TWD",
"đại hàn dân quốc weon": "KRW",
@@ -15068,6 +15092,7 @@
"ޕާކިސްތާނީ ރުޕީ": "PKR",
"रू": "NPR",
"रू.": "INR",
"অস্ট্রেলীয় ডলার": "AUD",
"অ্যাঙ্গোলীয় কুয়াঞ্জা": "AOA",
"আইসল্যান্ডীয় ক্রোনা": "ISK",
"আজারবাইজানি মানাত": "AZN",

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
],
"ua": "Mozilla/5.0 ({os}; rv:{version}) Gecko/20100101 Firefox/{version}",
"versions": [
"145.0",
"144.0"
"146.0",
"145.0"
]
}

View File

@@ -2319,11 +2319,6 @@
"symbol": "kJ/(kg K)",
"to_si_factor": 1000.0
},
"Q108888186": {
"si_name": "Q11570",
"symbol": "eV/c²",
"to_si_factor": 1.782661921627898e-36
},
"Q108888198": {
"si_name": "Q11570",
"symbol": "keV/c²",
@@ -4394,6 +4389,11 @@
"symbol": "m²",
"to_si_factor": 1.0
},
"Q25376902": {
"si_name": null,
"symbol": "Mbp",
"to_si_factor": null
},
"Q25377184": {
"si_name": "Q25377184",
"symbol": "kg/m²",
@@ -5344,11 +5344,6 @@
"symbol": "bhp EDR",
"to_si_factor": 12.958174
},
"Q3984193": {
"si_name": "Q25269",
"symbol": "TeV",
"to_si_factor": 1.602176634e-07
},
"Q39978339": {
"si_name": "Q25377184",
"symbol": "kg/cm²",

View File

@@ -2,10 +2,18 @@
# pylint: disable=invalid-name
"""360Search search engine for searxng"""
import typing as t
from urllib.parse import urlencode
from lxml import html
from searx import logger
from searx.enginelib import EngineCache
from searx.utils import extract_text
from searx.network import get as http_get
if t.TYPE_CHECKING:
from searx.extended_types import SXNG_Response
# Metadata
about = {
@@ -26,6 +34,35 @@ time_range_dict = {'day': 'd', 'week': 'w', 'month': 'm', 'year': 'y'}
# Base URL
base_url = "https://www.so.com"
COOKIE_CACHE_KEY = "cookie"
COOKIE_CACHE_EXPIRATION_SECONDS = 3600
CACHE: EngineCache
"""Stores cookies from 360search to avoid re-fetching them on every request."""
def setup(engine_settings: dict[str, t.Any]) -> bool:
"""Initialization of the engine.
- Instantiate a cache for this engine (:py:obj:`CACHE`).
"""
global CACHE # pylint: disable=global-statement
# table name needs to be quoted to start with digits, so "cache" has been added to avoid sqlite complaining
CACHE = EngineCache("cache" + engine_settings["name"])
return True
def get_cookie(url: str) -> str:
cookie: str | None = CACHE.get(COOKIE_CACHE_KEY)
if cookie:
return cookie
resp: SXNG_Response = http_get(url, timeout=10, allow_redirects=False)
headers = resp.headers
cookie = headers['set-cookie'].split(";")[0]
CACHE.set(key=COOKIE_CACHE_KEY, value=cookie, expire=COOKIE_CACHE_EXPIRATION_SECONDS)
return cookie
def request(query, params):
@@ -36,8 +73,13 @@ def request(query, params):
if time_range_dict.get(params['time_range']):
query_params["adv_t"] = time_range_dict.get(params['time_range'])
params["url"] = f"{base_url}/s?{urlencode(query_params)}"
# get token by calling the query page
logger.debug("querying url: %s", params["url"])
cookie = get_cookie(params["url"])
logger.debug("obtained cookie: %s", cookie)
params['headers'] = {'Cookie': cookie}
return params

View File

@@ -51,6 +51,7 @@ def request(query, params):
}
params["url"] = f"{base_url}?{urlencode(query_params)}"
params["headers"]["Referer"] = "https://www.bilibili.com"
params["cookies"] = cookie
return params

View File

@@ -341,6 +341,7 @@ engines:
- name: 360search
engine: 360search
shortcut: 360so
timeout: 10.0
disabled: true
- name: 360search videos
@@ -480,14 +481,14 @@ engines:
shortcut: ask
disabled: true
# - name: azure
# engine: azure
# shortcut: az
# categories: [it, cloud]
# azure_tenant_id: "your_tenant_id"
# azure_client_id: "your_client_id"
# azure_client_secret: "your_client_secret"
# disabled: true
- name: azure
engine: azure
shortcut: az
categories: [it, cloud]
# azure_tenant_id: "your_tenant_id"
# azure_client_id: "your_client_id"
# azure_client_secret: "your_client_secret"
inactive: true
# tmp suspended: dh key too small
# - name: base
@@ -649,7 +650,7 @@ engines:
# cf_ai_model_assistant: 'prompts_for_assistant_role'
# cf_ai_model_system: 'prompts_for_system_role'
timeout: 30
disabled: true
inactive: true
- name: core.ac.uk
engine: core
@@ -783,20 +784,20 @@ engines:
require_api_key: false
results: HTML
# - name: elasticsearch
# shortcut: els
# engine: elasticsearch
# base_url: http://localhost:9200
# username: elastic
# password: changeme
# index: my-index
# enable_http: true
# # available options: match, simple_query_string, term, terms, custom
# query_type: match
# # if query_type is set to custom, provide your query here
# # custom_query_json: {"query":{"match_all": {}}}
# # show_metadata: false
# disabled: true
- name: elasticsearch
shortcut: els
engine: elasticsearch
# base_url: http://localhost:9200
# username: elastic
# password: changeme
# index: my-index
# enable_http: true
# available options: match, simple_query_string, term, terms, custom
query_type: match
# if query_type is set to custom, provide your query here
# custom_query_json: {"query":{"match_all": {}}}
# show_metadata: false
inactive: true
- name: wikidata
engine: wikidata
@@ -874,12 +875,12 @@ engines:
require_api_key: false
results: HTML
# - name: ebay
# engine: ebay
# shortcut: eb
# base_url: 'https://www.ebay.com'
# disabled: true
# timeout: 5
- name: ebay
engine: ebay
shortcut: eb
base_url: 'https://www.ebay.com'
inactive: true
timeout: 5
- name: 1x
engine: www1x
@@ -900,12 +901,16 @@ engines:
- name: flickr
categories: images
shortcut: fl
engine: flickr_noapi
- name: flickr_api
# You can use the engine using the official stable API, but you need an API
# key, see: https://www.flickr.com/services/apps/create/
# engine: flickr
engine: flickr
categories: images
shortcut: fla
# api_key: 'apikey' # required!
# Or you can use the html non-stable engine, activated by default
engine: flickr_noapi
inactive: true
- name: free software directory
engine: mediawiki
@@ -919,13 +924,13 @@ engines:
website: https://directory.fsf.org/
wikidata_id: Q2470288
# - name: freesound
# engine: freesound
# shortcut: fnd
# disabled: true
# timeout: 15.0
# API key required, see: https://freesound.org/docs/api/overview.html
# api_key: MyAPIkey
- name: freesound
engine: freesound
shortcut: fnd
timeout: 15.0
# API key required, see: https://freesound.org/docs/api/overview.html
# api_key: MyAPIkey
inactive: true
- name: frinkiac
engine: frinkiac
@@ -980,7 +985,7 @@ engines:
- name: github code
engine: github_code
shortcut: ghc
disabled: true
inactive: true
ghc_auth:
# type is one of:
# * none
@@ -1267,9 +1272,9 @@ engines:
# https://github.com/LibreTranslate/LibreTranslate?tab=readme-ov-file#mirrors
base_url:
- https://libretranslate.com/translate
# api_key: abc123
# api_key: ''
shortcut: lt
disabled: true
inactive: true
- name: lingva
engine: lingva
@@ -1306,7 +1311,7 @@ engines:
shortcut: mar
# To get an API key, please follow the instructions at
# - https://about.marginalia-search.com/article/api/
# api_key: ...
# api_key: ''
disabled: true
inactive: true
@@ -2087,19 +2092,19 @@ engines:
# engine in combination with Jackett opens the possibility to query a lot of
# public and private indexers directly from SearXNG. More details at:
# https://docs.searxng.org/dev/engines/online/torznab.html
#
# - name: Torznab EZTV
# engine: torznab
# shortcut: eztv
# base_url: http://localhost:9117/api/v2.0/indexers/eztv/results/torznab
# enable_http: true # if using localhost
# api_key: xxxxxxxxxxxxxxx
# show_magnet_links: true
# show_torrent_files: false
# # https://github.com/Jackett/Jackett/wiki/Jackett-Categories
# torznab_categories: # optional
# - 2000
# - 5000
- name: Torznab EZTV
engine: torznab
shortcut: eztv
# base_url: http://localhost:9117/api/v2.0/indexers/eztv/results/torznab
# enable_http: true # if using localhost
# api_key: xxxxxxxxxxxxxxx
show_magnet_links: true
show_torrent_files: false
# https://github.com/Jackett/Jackett/wiki/Jackett-Categories
torznab_categories: # optional
- 2000
- 5000
inactive: true
# tmp suspended - too slow, too many errors
# - name: urbandictionary
@@ -2147,14 +2152,15 @@ engines:
- name: youtube
shortcut: yt
engine: youtube_noapi
- name: youtube_api
# You can use the engine using the official stable API, but you need an API
# key See: https://console.developers.google.com/project
#
# engine: youtube_api
# api_key: 'apikey' # required!
#
# Or you can use the html non-stable engine, activated by default
engine: youtube_noapi
engine: youtube_api
# api_key: '' # required!
shortcut: yta
inactive: true
- name: dailymotion
engine: dailymotion
@@ -2307,18 +2313,21 @@ engines:
- name: wolframalpha
shortcut: wa
# You can use the engine using the official stable API, but you need an API
# key. See: https://products.wolframalpha.com/api/
#
# engine: wolframalpha_api
# api_key: ''
#
# Or you can use the html non-stable engine, activated by default
engine: wolframalpha_noapi
timeout: 6.0
categories: general
disabled: true
- name: wolframalpha_api
# You can use the engine using the official stable API, but you need an API
# key. See: https://products.wolframalpha.com/api/
engine: wolframalpha_api
# api_key: '' # required!
shortcut: waa
timeout: 6.0
categories: general
inactive: true
- name: dictzone
engine: dictzone
shortcut: dc
@@ -2366,14 +2375,14 @@ engines:
engine: seznam
disabled: true
# - name: deepl
# engine: deepl
# shortcut: dpl
# # You can use the engine using the official stable API, but you need an API key
# # See: https://www.deepl.com/pro-api?cta=header-pro-api
# api_key: '' # required!
# timeout: 5.0
# disabled: true
- name: deepl
engine: deepl
shortcut: dpl
# You can use the engine using the official stable API, but you need an API key
# See: https://www.deepl.com/pro-api?cta=header-pro-api
# api_key: '' # required!
timeout: 5.0
inactive: true
- name: mojeek
shortcut: mjk
@@ -2588,7 +2597,7 @@ engines:
engine: wallhaven
# api_key: abcdefghijklmnopqrstuvwxyz
shortcut: wh
disabled: true
inactive: true
# wikimini: online encyclopedia for children
# The fulltext and title parameter is necessary for Wikimini because