mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 10:32:21 +02:00
[mod] fetch supported languages for several engines
utils/fetch_languages.py gets languages supported by each engine and generates engines_languages.json with each engine's supported language.
This commit is contained in:
parent
92c6e88ad3
commit
f62ce21f50
26 changed files with 3633 additions and 362 deletions
|
@ -22,7 +22,7 @@ language = ""
|
|||
|
||||
# search-url
|
||||
url = 'http://www.subtitleseeker.com/'
|
||||
search_url = url + 'search/TITLES/{query}&p={pageno}'
|
||||
search_url = url + 'search/TITLES/{query}?p={pageno}'
|
||||
|
||||
# specific xpath variables
|
||||
results_xpath = '//div[@class="boxRows"]'
|
||||
|
@ -51,7 +51,8 @@ def response(resp):
|
|||
elif resp.search_params['language'] != 'all':
|
||||
search_lang = [lc[3]
|
||||
for lc in language_codes
|
||||
if lc[0][:2] == resp.search_params['language'].split('_')[0]][0]
|
||||
if lc[0].split('-')[0] == resp.search_params['language'].split('-')[0]]
|
||||
search_lang = search_lang[0].split(' (')[0]
|
||||
|
||||
# parse results
|
||||
for result in dom.xpath(results_xpath):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue