22def on_result(_request, _search, result):
23 if 'parsed_url' not in result:
24 return True
25
26 query = result['parsed_url'].query
27
28 if query == "":
29 return True
30 parsed_query = parse_qsl(query)
31
32 changes = 0
33 for i, (param_name, _) in enumerate(list(parsed_query)):
34 for reg in regexes:
35 if reg.match(param_name):
36 parsed_query.pop(i - changes)
37 changes += 1
38 result['parsed_url'] = result['parsed_url']._replace(query=urlencode(parsed_query))
39 result['url'] = urlunparse(result['parsed_url'])
40 break
41
42 return True