.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.plugins.ahmia_filter Namespace Reference

Functions

 on_result (_request, _search, result)
 
 init (_app, settings)
 

Variables

str name = "Ahmia blacklist"
 
str description = "Filter out onion results that appear in Ahmia's blacklist. (See https://ahmia.fi/blacklist)"
 
bool default_on = True
 
str preference_section = 'onions'
 
 ahmia_blacklist = None
 

Function Documentation

◆ init()

searx.plugins.ahmia_filter.init ( _app,
settings )

Definition at line 22 of file ahmia_filter.py.

22def init(_app, settings):
23 global ahmia_blacklist # pylint: disable=global-statement
24 if not settings['outgoing']['using_tor_proxy']:
25 # disable the plugin
26 return False
27 ahmia_blacklist = ahmia_blacklist_loader()
28 return True

◆ on_result()

searx.plugins.ahmia_filter.on_result ( _request,
_search,
result )

Definition at line 15 of file ahmia_filter.py.

15def on_result(_request, _search, result):
16 if not result.get('is_onion') or not result.get('parsed_url'):
17 return True
18 result_hash = md5(result['parsed_url'].hostname.encode()).hexdigest()
19 return result_hash not in ahmia_blacklist
20
21

Variable Documentation

◆ ahmia_blacklist

searx.plugins.ahmia_filter.ahmia_blacklist = None

Definition at line 12 of file ahmia_filter.py.

◆ default_on

bool searx.plugins.ahmia_filter.default_on = True

Definition at line 9 of file ahmia_filter.py.

◆ description

str searx.plugins.ahmia_filter.description = "Filter out onion results that appear in Ahmia's blacklist. (See https://ahmia.fi/blacklist)"

Definition at line 8 of file ahmia_filter.py.

◆ name

str searx.plugins.ahmia_filter.name = "Ahmia blacklist"

Definition at line 7 of file ahmia_filter.py.

◆ preference_section

str searx.plugins.ahmia_filter.preference_section = 'onions'

Definition at line 10 of file ahmia_filter.py.