diff options
author | Noémi Ványi <sitbackandwait@gmail.com> | 2019-09-23 17:14:32 +0200 |
---|---|---|
committer | Noémi Ványi <sitbackandwait@gmail.com> | 2019-10-16 15:52:48 +0200 |
commit | a6f20caf32af463b57a026ee7cb7ed6317db6b8b (patch) | |
tree | c180f804d1a80767ab50b7cffb42aa75f9c3806a /searx/plugins | |
parent | 2946c5f10695634be1f1266142bec5572139085f (diff) | |
download | searxng-a6f20caf32af463b57a026ee7cb7ed6317db6b8b.tar.gz searxng-a6f20caf32af463b57a026ee7cb7ed6317db6b8b.zip |
add initial support for offline engines && command engine
Diffstat (limited to 'searx/plugins')
-rw-r--r-- | searx/plugins/https_rewrite.py | 3 | ||||
-rw-r--r-- | searx/plugins/oa_doi_rewrite.py | 3 | ||||
-rw-r--r-- | searx/plugins/tracker_url_remover.py | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/searx/plugins/https_rewrite.py b/searx/plugins/https_rewrite.py index 3d986770e..82556017e 100644 --- a/searx/plugins/https_rewrite.py +++ b/searx/plugins/https_rewrite.py @@ -225,6 +225,9 @@ def https_url_rewrite(result): def on_result(request, search, result): + if 'parsed_url' not in result: + return True + if result['parsed_url'].scheme == 'http': https_url_rewrite(result) return True diff --git a/searx/plugins/oa_doi_rewrite.py b/searx/plugins/oa_doi_rewrite.py index d4942498f..be80beb26 100644 --- a/searx/plugins/oa_doi_rewrite.py +++ b/searx/plugins/oa_doi_rewrite.py @@ -35,6 +35,9 @@ def get_doi_resolver(args, preference_doi_resolver): def on_result(request, search, result): + if 'parsed_url' not in result: + return True + doi = extract_doi(result['parsed_url']) if doi and len(doi) < 50: for suffix in ('/', '.pdf', '/full', '/meta', '/abstract'): diff --git a/searx/plugins/tracker_url_remover.py b/searx/plugins/tracker_url_remover.py index 8cc063bba..9e18867b9 100644 --- a/searx/plugins/tracker_url_remover.py +++ b/searx/plugins/tracker_url_remover.py @@ -30,6 +30,9 @@ preference_section = 'privacy' def on_result(request, search, result): + if 'parsed_url' not in result: + return True + query = result['parsed_url'].query if query == "": |