mirror of
				https://github.com/searxng/searxng
				synced 2024-01-01 19:24:07 +01:00 
			
		
		
		
	Merge pull request #2059 from dalf/bang-encoding
[mod] external_bang.py: always read bangs.json with a UTF-8 file.
This commit is contained in:
		
						commit
						c41db5f1ba
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -9,7 +9,7 @@ from searx import searx_dir
 | 
			
		|||
# NOTE only use the get_bang_url
 | 
			
		||||
 | 
			
		||||
bangs_data = {}
 | 
			
		||||
with open(join(searx_dir, 'data/bangs.json')) as json_file:
 | 
			
		||||
with open(join(searx_dir, 'data/bangs.json'), encoding='utf-8') as json_file:
 | 
			
		||||
    for bang in json.load(json_file)['bang']:
 | 
			
		||||
        for trigger in bang["triggers"]:
 | 
			
		||||
            bangs_data[trigger] = {x: y for x, y in bang.items() if x != "triggers"}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue