Browse Source

[fix] gigablast url params

Adam Tauber 9 years ago
parent
commit
f1ac794a07
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      searx/engines/gigablast.py

+ 6
- 2
searx/engines/gigablast.py View File

@@ -13,6 +13,8 @@
13 13
 from urllib import urlencode
14 14
 from cgi import escape
15 15
 from lxml import etree
16
+from random import randint
17
+from time import time
16 18
 
17 19
 # engine dependent config
18 20
 categories = ['general']
@@ -21,7 +23,7 @@ number_of_results = 5
21 23
 
22 24
 # search-url, invalid HTTPS certificate
23 25
 base_url = 'http://gigablast.com/'
24
-search_string = 'search?{query}&n={number_of_results}&s={offset}&xml=1&qh=0'
26
+search_string = 'search?{query}&n={number_of_results}&s={offset}&xml=1&qh=0&uxid={uxid}&rand={rand}'
25 27
 
26 28
 # specific xpath variables
27 29
 results_xpath = '//response//result'
@@ -37,7 +39,9 @@ def request(query, params):
37 39
     search_path = search_string.format(
38 40
         query=urlencode({'q': query}),
39 41
         offset=offset,
40
-        number_of_results=number_of_results)
42
+        number_of_results=number_of_results,
43
+        uxid=randint(10000, 10000000),
44
+        rand=int(time()))
41 45
 
42 46
     params['url'] = base_url + search_path
43 47