on master help sign in
[fix] close #197 for all engines
commit5029cb478755c152bfa7da2f6381cd95cc4ee238 authordalf <alex@al-f.net> dateFri 13 Feb 2015, 11:17 (12 years ago) parentec2516b
2 files changed+5−5
searx/engines/kickass.py−5 searx/search.py+5
searx/engines/kickass.py−5
@@ -45,11 +45,6 @@ def request(query, params):
4545def response(resp):
4646 results = []
4747
48− # check if redirect comparing to the True value,
49− # because resp can be a Mock object, and any attribut name returns something.
50− if resp.is_redirect is True:
51− return results
52−
5348 dom = html.fromstring(resp.text)
5449
5550 search_res = dom.xpath('//table[@class="data"]//tr')
searx/search.py+5
@@ -87,6 +87,11 @@ def make_callback(engine_name, results_queue, callback, params):
8787
8888 # creating a callback wrapper for the search engine results
8989 def process_callback(response, **kwargs):
90+ # check if redirect comparing to the True value,
91+ # because resp can be a Mock object, and any attribut name returns something.
92+ if response.is_redirect is True:
93+ return
94+
9095 response.search_params = params
9196
9297 timeout_overhead = 0.2 # seconds