replace params by preferences

pull/867/head
Joao Ramos 2 years ago
parent a3fa999b0d
commit c56d1455f7

@ -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

@ -24,7 +24,7 @@
<h4><a class="link" href="https://farside.link">{{ translation['continue-search'] }}</a></h4>
Whoogle:
<br>
<a class="link-color" href="{{farside}}/whoogle/search?q={{query}}{{params}}">
<a class="link-color" href="{{farside}}/whoogle/search?q={{query}}">
{{farside}}/whoogle/search?q={{query}}{{params}}
</a>
<br><br>

Loading…
Cancel
Save