Replace error query params w/ preferences param (#867)

pull/872/head^2
João 2 years ago committed by GitHub
parent 75682de892
commit 2a37619028
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -158,14 +158,17 @@ class Config:
self[param_key] = param_val
return self
def to_params(self) -> str:
def to_params(self, keys: list = []) -> str:
"""Generates a set of safe params for using in Whoogle URLs
Returns:
str -- a set of URL parameters
"""
if not len(keys):
keys = self.safe_keys
param_str = ''
for safe_key in self.safe_keys:
for safe_key in keys:
if not self[safe_key]:
continue
param_str = param_str + f'&{safe_key}={self[safe_key]}'

@ -326,7 +326,7 @@ def search():
farside='https://farside.link',
config=g.user_config,
query=urlparse.unquote(query),
params=g.user_config.to_params()), 503
params=g.user_config.to_params(keys=['preferences'])), 503
response = bold_search_terms(response, query)
# Feature to display IP address

@ -25,7 +25,7 @@
Whoogle:
<br>
<a class="link-color" href="{{farside}}/whoogle/search?q={{query}}{{params}}">
{{farside}}/whoogle/search?q={{query}}{{params}}
{{farside}}/whoogle/search?q={{query}}
</a>
<br><br>
Searx:

Loading…
Cancel
Save