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
  @using-api   yes
4
  @using-api   yes
5
  @results     JSON
5
  @results     JSON
6
  @stable      yes
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
 from json import loads
11
 from json import loads
39
 # do search-request
40
 # do search-request
40
 def request(query, params):
41
 def request(query, params):
41
     search_after = get_time_range(params['time_range'])
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
     return params
50
     return params
48
 
51