From 3a160d3aed9d5eb7cebe2427f9009b4e0e2f07c4 Mon Sep 17 00:00:00 2001 From: Popolon Date: Mon, 6 Aug 2018 00:53:55 +0200 Subject: [PATCH 1/3] return doi resolver url instead of doi resolver name --- searx/plugins/oa_doi_rewrite.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/searx/plugins/oa_doi_rewrite.py b/searx/plugins/oa_doi_rewrite.py index b62ef0b1e..d078f1377 100644 --- a/searx/plugins/oa_doi_rewrite.py +++ b/searx/plugins/oa_doi_rewrite.py @@ -30,7 +30,8 @@ def get_doi_resolver(args, preference_doi_resolver): doi_resolver = args.get('doi_resolver', preference_doi_resolver)[0] if doi_resolver not in doi_resolvers: doi_resolvers = settings['default_doi_resolver'] - return doi_resolver + doi_resolver_url = doi_resolvers[doi_resolver] + return doi_resolver_url def on_result(request, search, result): From 34af9a01418aa6c1efcaa6d30b0cceb504805ba3 Mon Sep 17 00:00:00 2001 From: Popolon Date: Mon, 6 Aug 2018 01:03:40 +0200 Subject: [PATCH 2/3] add http://sci-hub.tw/ as doi resolvers #1216 --- searx/settings.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/searx/settings.yml b/searx/settings.yml index 1b18f55b3..ae9b928c2 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -766,5 +766,6 @@ doi_resolvers : oadoi.org : 'https://oadoi.org/' doi.org : 'https://doi.org/' doai.io : 'http://doai.io/' + sci-hub.tw : 'http://sci-hub.tw/' default_doi_resolver : 'oadoi.org' From 00b8aa113f874b531daed90c5bccbf4308153b03 Mon Sep 17 00:00:00 2001 From: Popolon Date: Tue, 7 Aug 2018 17:57:33 +0200 Subject: [PATCH 3/3] remove double spaces --- searx/plugins/oa_doi_rewrite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/plugins/oa_doi_rewrite.py b/searx/plugins/oa_doi_rewrite.py index d078f1377..d316d14fc 100644 --- a/searx/plugins/oa_doi_rewrite.py +++ b/searx/plugins/oa_doi_rewrite.py @@ -30,7 +30,7 @@ def get_doi_resolver(args, preference_doi_resolver): doi_resolver = args.get('doi_resolver', preference_doi_resolver)[0] if doi_resolver not in doi_resolvers: doi_resolvers = settings['default_doi_resolver'] - doi_resolver_url = doi_resolvers[doi_resolver] + doi_resolver_url = doi_resolvers[doi_resolver] return doi_resolver_url