mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 21:59:22 +02:00
fetch google's search langs rather than ui langs
This commit is contained in:
parent
c86504b47a
commit
ecf5899153
3 changed files with 482 additions and 1441 deletions
|
@ -282,11 +282,11 @@ def _fetch_supported_languages(resp):
|
|||
ret_val = {}
|
||||
dom = html.fromstring(resp.text)
|
||||
|
||||
radio_buttons = eval_xpath(dom, '//*[@id="langSec"]//input[@name="lang"]')
|
||||
radio_buttons = eval_xpath(dom, '//*[@id="langSec"]//input[@name="lr"]')
|
||||
|
||||
for x in radio_buttons:
|
||||
name = x.get("data-name")
|
||||
code = x.get("value")
|
||||
code = x.get("value").split('_')[-1]
|
||||
ret_val[code] = {"name": name}
|
||||
|
||||
return ret_val
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue