diff options
author | Alexandre Flament <alex@al-f.net> | 2021-09-07 19:39:00 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-09-09 11:31:46 +0200 |
commit | b941763e206a572018b70a9218ecd01c133c942d (patch) | |
tree | 6b1b5bfbebb0222d185be020c2ccc6c23a20f69c /searx/plugins/ahmia_filter.py | |
parent | 660c1801705e56a81cf02574f48cc194fec95b1f (diff) | |
download | searxng-b941763e206a572018b70a9218ecd01c133c942d.tar.gz searxng-b941763e206a572018b70a9218ecd01c133c942d.zip |
[mod] ahmia_filter: use on_result instead of post_search
see commit 6c9ae7911e9639bc46cd53af215734b4bdb61ba9
Diffstat (limited to 'searx/plugins/ahmia_filter.py')
-rw-r--r-- | searx/plugins/ahmia_filter.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/searx/plugins/ahmia_filter.py b/searx/plugins/ahmia_filter.py index 83b05e4d2..70f216ee1 100644 --- a/searx/plugins/ahmia_filter.py +++ b/searx/plugins/ahmia_filter.py @@ -20,14 +20,8 @@ def get_ahmia_blacklist(): return ahmia_blacklist -def not_blacklisted(result): +def on_result(request, search, result): if not result.get('is_onion') or not result.get('parsed_url'): return True result_hash = md5(result['parsed_url'].hostname.encode()).hexdigest() return result_hash not in get_ahmia_blacklist() - - -def post_search(request, search): - filtered_results = list(filter(not_blacklisted, search.result_container._merged_results)) - search.result_container._merged_results = filtered_results - return True |