mirror of
				https://github.com/searxng/searxng.git
				synced 2025-10-31 10:37:06 -04:00 
			
		
		
		
	Add language support
Allow the user to select a language. It must be written in english, and capitalized, ie : English, French, German, Hungarian... (reverted from commit 829948b85df0510e331372bcd60cb31db9c96a5c)
This commit is contained in:
		
							parent
							
								
									829948b85d
								
							
						
					
					
						commit
						2ea55b1c64
					
				| @ -16,8 +16,6 @@ from lxml import html | |||||||
| categories = ['videos'] | categories = ['videos'] | ||||||
| paging = True | paging = True | ||||||
| 
 | 
 | ||||||
| language = "" |  | ||||||
| 
 |  | ||||||
| # search-url | # search-url | ||||||
| url = 'http://www.subtitleseeker.com/' | url = 'http://www.subtitleseeker.com/' | ||||||
| search_url = url+'search/TITLES/{query}&p={pageno}' | search_url = url+'search/TITLES/{query}&p={pageno}' | ||||||
| @ -43,10 +41,6 @@ def response(resp): | |||||||
|     for result in dom.xpath(results_xpath): |     for result in dom.xpath(results_xpath): | ||||||
|         link = result.xpath(".//a")[0] |         link = result.xpath(".//a")[0] | ||||||
|         href = link.attrib.get('href') |         href = link.attrib.get('href') | ||||||
|          |  | ||||||
|         if language is not "": |  | ||||||
|             href = href + language + "/" |  | ||||||
| 
 |  | ||||||
|         title = escape(link.xpath(".//text()")[0]) |         title = escape(link.xpath(".//text()")[0]) | ||||||
| 
 | 
 | ||||||
|         content = result.xpath('.//div[contains(@class,"red")]//text()')[0] |         content = result.xpath('.//div[contains(@class,"red")]//text()')[0] | ||||||
|  | |||||||
| @ -1,13 +1,13 @@ | |||||||
| server: | server: | ||||||
|     port : 2722 |     port : 8888 | ||||||
|     secret_key : "8f92c98926f04c8cb2a5fdc3bca19f7c" # change this! |     secret_key : "ultrasecretkey" # change this! | ||||||
|     debug : True # Debug mode, only for development |     debug : False # Debug mode, only for development | ||||||
|     request_timeout : 2.0 # seconds |     request_timeout : 2.0 # seconds | ||||||
|     base_url : False # Set custom base_url. Possible values: False or "https://your.custom.host/location/" |     base_url : False # Set custom base_url. Possible values: False or "https://your.custom.host/location/" | ||||||
|     themes_path : "" # Custom ui themes path |     themes_path : "" # Custom ui themes path | ||||||
|     default_theme : default # ui theme |     default_theme : default # ui theme | ||||||
|     https_rewrite : True # Force rewrite result urls. See searx/https_rewrite.py |     https_rewrite : True # Force rewrite result urls. See searx/https_rewrite.py | ||||||
|     useragent_suffix : "Cqcb Style" # suffix of searx_useragent, could contain informations like an email address to the administrator |     useragent_suffix : "" # suffix of searx_useragent, could contain informations like an email address to the administrator | ||||||
| 
 | 
 | ||||||
| engines: | engines: | ||||||
|   - name : wikipedia |   - name : wikipedia | ||||||
| @ -130,9 +130,6 @@ engines: | |||||||
|   - name : subtitleseeker |   - name : subtitleseeker | ||||||
|     engine : subtitleseeker |     engine : subtitleseeker | ||||||
|     shortcut : ss |     shortcut : ss | ||||||
| # The language is an option. You can put any language written in english |  | ||||||
| # Examples : English, French, German, Hungarian, Chinese... |  | ||||||
| #    language : English |  | ||||||
| 
 | 
 | ||||||
|   - name : startpage |   - name : startpage | ||||||
|     engine : startpage |     engine : startpage | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user