mirror of
https://github.com/searxng/searxng.git
synced 2025-09-01 07:48:32 +02:00
[enh] add supported_languages on engines and auto-generate languages.py
This commit is contained in:
parent
e58949b76f
commit
149802c569
34 changed files with 666 additions and 128 deletions
|
@ -12,6 +12,8 @@
|
|||
|
||||
from lxml import html
|
||||
from urllib import urlencode
|
||||
from json import loads
|
||||
from searx.engines.google import supported_languages
|
||||
|
||||
# search-url
|
||||
categories = ['news']
|
||||
|
@ -50,7 +52,7 @@ def request(query, params):
|
|||
search_options=urlencode(search_options))
|
||||
|
||||
if params['language'] != 'all':
|
||||
language_array = params['language'].lower().split('_')
|
||||
language_array = params['language'].lower().split('-')
|
||||
params['url'] += '&lr=lang_' + language_array[0]
|
||||
|
||||
return params
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue