Pārlūkot izejas kodu

[fix] is_valid_lang fixed for new languages.py + dictzone engine encoding

potato 7 gadus atpakaļ
vecāks
revīzija
9b82cb1908
2 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 1
    1
      searx/engines/dictzone.py
  2. 2
    2
      searx/utils.py

+ 1
- 1
searx/engines/dictzone.py Parādīt failu

@@ -37,7 +37,7 @@ def request(query, params):
37 37
 
38 38
     params['url'] = url.format(from_lang=from_lang[2],
39 39
                                to_lang=to_lang[2],
40
-                               query=query)
40
+                               query=query.decode('utf-8'))
41 41
 
42 42
     return params
43 43
 

+ 2
- 2
searx/utils.py Parādīt failu

@@ -295,12 +295,12 @@ def is_valid_lang(lang):
295 295
     if is_abbr:
296 296
         for l in language_codes:
297 297
             if l[0][:2] == lang.lower():
298
-                return (True, l[0][:2], l[1].lower())
298
+                return (True, l[0][:2], l[3].lower())
299 299
         return False
300 300
     else:
301 301
         for l in language_codes:
302 302
             if l[1].lower() == lang.lower():
303
-                return (True, l[0][:2], l[1].lower())
303
+                return (True, l[0][:2], l[3].lower())
304 304
         return False
305 305
 
306 306