diff options
author | Alexandre Flament <alex@al-f.net> | 2021-02-25 17:42:52 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-03-04 11:59:14 +0100 |
commit | b8cd3264644208d7afa1a239f829222d45226334 (patch) | |
tree | abbbd7fe188e7837f8351935ec47877799bc9474 /utils/google_search.py | |
parent | 111d38cd8fe35365cab2121a362bd17159c66d3f (diff) | |
download | searxng-b8cd3264644208d7afa1a239f829222d45226334.tar.gz searxng-b8cd3264644208d7afa1a239f829222d45226334.zip |
Add searx_extra package
Split the utils directory into:
* searx_extra contains update scripts, standalone_searx.py
* utils contains the files to build and setup searx.
Diffstat (limited to 'utils/google_search.py')
-rw-r--r-- | utils/google_search.py | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/utils/google_search.py b/utils/google_search.py deleted file mode 100644 index cad32eeca..000000000 --- a/utils/google_search.py +++ /dev/null @@ -1,35 +0,0 @@ -from sys import argv, exit - -if not len(argv) > 1: - print('search query required') - exit(1) - -import requests -from json import dumps -from searx.engines import google -from searx.search import default_request_params - -request_params = default_request_params() -# Possible params -# request_params['headers']['User-Agent'] = '' -# request_params['category'] = '' -request_params['pageno'] = 1 -request_params['language'] = 'en_us' -request_params['time_range'] = '' - -params = google.request(argv[1], request_params) - -request_args = dict( - headers=request_params['headers'], - cookies=request_params['cookies'], -) - -if request_params['method'] == 'GET': - req = requests.get -else: - req = requests.post - request_args['data'] = request_params['data'] - -resp = req(request_params['url'], **request_args) -resp.search_params = request_params -print(dumps(google.response(resp))) |