@@ -16,6 +16,8 @@ from json import loads
1616from dateutil import parser
1717from urllib.parse import urlencode
1818
19+from requests.auth import HTTPDigestAuth
20+
1921from searx.utils import html_to_text
2022
2123# engine dependent config
@@ -23,6 +25,8 @@ categories = ['general', 'images'] # TODO , 'music', 'videos', 'files'
2325paging = True
2426language_support = True
2527number_of_results = 5
28+http_digest_auth_user = ""
29+http_digest_auth_pass = ""
2630
2731# search-url
2832base_url = 'http://localhost:8090'
@@ -51,6 +55,9 @@ def request(query, params):
5155 limit=number_of_results,
5256 search_type=search_type)
5357
58+ if http_digest_auth_user and http_digest_auth_pass:
59+ params['auth'] = HTTPDigestAuth(http_digest_auth_user, http_digest_auth_pass)
60+
5461 # add language tag if specified
5562 if params['language'] != 'all':
5663 params['url'] += '&lr=lang_' + params['language'].split('-')[0]
@@ -75,7 +82,7 @@ def response(resp):
7582
7683 for result in search_results[0].get('items', []):
7784 # parse image results
78− if result.get('image') and result.get('width') and result.get('height'):
85+ if resp.search_params.get('category') == 'images':
7986
8087 result_url = ''
8188 if 'url' in result:
@@ -104,5 +111,4 @@ def response(resp):
104111
105112 # TODO parse video, audio and file results
106113
107− # return results
108114 return results