From 7ee9b618dc1db4d32815762ca2ee5ccc8a370ce0 Mon Sep 17 00:00:00 2001 From: mol Date: Wed, 6 Dec 2023 12:53:46 +0800 Subject: [PATCH] feat: wikijs --- engines/wikijs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engines/wikijs.py b/engines/wikijs.py index 9beca0f..43947ed 100644 --- a/engines/wikijs.py +++ b/engines/wikijs.py @@ -21,7 +21,7 @@ host = '' cookies = {} headers = { - "Authorization": 'Bearer %s' % search_token + "Authorization": '' } '''Some engines might offer different result based on cookies or headers. Possible use-case: To set safesearch cookie or header to moderate.''' @@ -98,11 +98,12 @@ def request(query, params): if paging and search_url.find('{pageno}') >= 0: fp['pageno'] = (params['pageno'] - 1) * page_size + first_page_num + header['Authorization'] = 'Bearer %s' % search_token params['cookies'].update(cookies) params['headers'].update(headers) - + params['url'] = host + '?=query{pages {search(query: %s) {results{id title description path locale __typename} suggestions totalHits __typename} __typename }}' % query - + print(params['url']) return params