From d6446be38f3f858c09887a89c8fc490a3c300b95 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Fri, 23 Sep 2022 19:58:14 +0200 Subject: [mod] science category: various update of about PR 1705 --- searx/engines/semantic_scholar.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'searx/engines/semantic_scholar.py') diff --git a/searx/engines/semantic_scholar.py b/searx/engines/semantic_scholar.py index b2701c333..7a1b5b231 100644 --- a/searx/engines/semantic_scholar.py +++ b/searx/engines/semantic_scholar.py @@ -48,7 +48,6 @@ def request(query, params): def response(resp): res = loads(resp.text) results = [] - for result in res['results']: url = result.get('primaryPaperLink', {}).get('url') if not url and result.get('links'): @@ -72,7 +71,7 @@ def response(resp): # pick for the first alternate link, but not from the crawler pdf_url = None for doc in result.get('alternatePaperLinks', []): - if doc['linkType'] != 'crawler': + if doc['linkType'] not in ('crawler', 'doi'): pdf_url = doc['url'] break -- cgit v1.2.3-54-g00ecf