diff options
author | Adam Tauber <adam.tauber@balabit.com> | 2015-10-16 12:05:50 +0200 |
---|---|---|
committer | Adam Tauber <adam.tauber@balabit.com> | 2015-10-16 12:05:50 +0200 |
commit | f1ac794a0737c76516cf6c324027f2dd718a67a1 (patch) | |
tree | 594f98b82db562c808fe0a90f4c80eaeccd87996 | |
parent | 5da78f7b37b60a6e100e245de99a0ba45be49f01 (diff) | |
download | searxng-f1ac794a0737c76516cf6c324027f2dd718a67a1.tar.gz searxng-f1ac794a0737c76516cf6c324027f2dd718a67a1.zip |
[fix] gigablast url params
-rw-r--r-- | searx/engines/gigablast.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.py index b852de9ba..cfc8e7159 100644 --- a/searx/engines/gigablast.py +++ b/searx/engines/gigablast.py @@ -13,6 +13,8 @@ from urllib import urlencode from cgi import escape from lxml import etree +from random import randint +from time import time # engine dependent config categories = ['general'] @@ -21,7 +23,7 @@ number_of_results = 5 # search-url, invalid HTTPS certificate base_url = 'http://gigablast.com/' -search_string = 'search?{query}&n={number_of_results}&s={offset}&xml=1&qh=0' +search_string = 'search?{query}&n={number_of_results}&s={offset}&xml=1&qh=0&uxid={uxid}&rand={rand}' # specific xpath variables results_xpath = '//response//result' @@ -37,7 +39,9 @@ def request(query, params): search_path = search_string.format( query=urlencode({'q': query}), offset=offset, - number_of_results=number_of_results) + number_of_results=number_of_results, + uxid=randint(10000, 10000000), + rand=int(time())) params['url'] = base_url + search_path |