Browse Source

- recoll.py: sanitize url handling

frankdelange 6 years ago
parent
commit
9e0b6c3e63
1 changed files with 8 additions and 5 deletions
  1. 8
    5
      searx/engines/recoll.py

+ 8
- 5
searx/engines/recoll.py View File

@@ -4,7 +4,8 @@
4 4
  @using-api   yes
5 5
  @results     JSON
6 6
  @stable      yes
7
- @parse       url, content, size, abstract, author, mtype, time, filename, label
7
+ @parse       url, content, size, abstract, author, mtype, time, \
8
+              filename, label
8 9
 """
9 10
 
10 11
 from json import loads
@@ -39,10 +40,12 @@ def get_time_range(time_range):
39 40
 # do search-request
40 41
 def request(query, params):
41 42
     search_after = get_time_range(params['time_range'])
42
-    search_url = base_url + 'json?query={query}&page={page}&after={after}&dir={dir}&highlight=0'
43
-
44
-    params['url'] = search_url.format(query=urlencode({'q': query}), page=params['pageno'],
45
-                                      after=search_after, dir=search_dir)
43
+    search_url = base_url + 'json?{query}&highlight=0'
44
+    params['url'] = search_url.format(query=urlencode({
45
+        'query': query,
46
+        'page': params['pageno'],
47
+        'after': search_after,
48
+        'dir': search_dir}))
46 49
 
47 50
     return params
48 51