Browse Source

Merge pull request #237 from dalf/master

[fix] close #197 for all engines
Adam Tauber 10 years ago
parent
commit
3ff269c84c
2 changed files with 5 additions and 5 deletions
  1. 0
    5
      searx/engines/kickass.py
  2. 5
    0
      searx/search.py

+ 0
- 5
searx/engines/kickass.py View File

@@ -45,11 +45,6 @@ def request(query, params):
45 45
 def response(resp):
46 46
     results = []
47 47
 
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
-
53 48
     dom = html.fromstring(resp.text)
54 49
 
55 50
     search_res = dom.xpath('//table[@class="data"]//tr')

+ 5
- 0
searx/search.py View File

@@ -87,6 +87,11 @@ def make_callback(engine_name, results_queue, callback, params):
87 87
 
88 88
     # creating a callback wrapper for the search engine results
89 89
     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
+
90 95
         response.search_params = params
91 96
 
92 97
         timeout_overhead = 0.2  # seconds