Disguise URLs so Firefox doesn't recognise them and filter them out

This commit is contained in:
Daoud Clarke 2022-08-13 10:49:55 +01:00
parent a8bbb9f303
commit 9920fc5ddd
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ class Ranker:
def complete(self, q: str):
ordered_results, terms, completions = self.get_results(q)
filtered_completions = [c for c in completions if c != terms[-1]]
urls = [item.url[len(HTTPS_STRING):].rstrip('/') for item in ordered_results[:5]
urls = [item.url[len(HTTPS_STRING):].rstrip('/').replace('.', '').replace('/', ' ') for item in ordered_results[:5]
if item.url.startswith(HTTPS_STRING) and all(term in item.url for term in terms)][:1]
completed = [' '.join(terms[:-1] + [t]) for t in filtered_completions]
return [q, urls + completed]