From 78bff4618cd4db242d4b7e27ef42b465a0df5484 Mon Sep 17 00:00:00 2001 From: ta Date: Wed, 24 Aug 2022 18:31:04 +0700 Subject: [PATCH] add safesearch support --- searx/engines/apple_app_store.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/searx/engines/apple_app_store.py b/searx/engines/apple_app_store.py index fe8f6ec83..112c58224 100644 --- a/searx/engines/apple_app_store.py +++ b/searx/engines/apple_app_store.py @@ -21,12 +21,18 @@ about = { } categories = ['files', 'apps'] +safesearch = True search_url = 'https://itunes.apple.com/search?{query}' def request(query, params): - params['url'] = search_url.format(query=urlencode({'term': query, 'media': 'software'})) + explicit = "Yes" + + if params['safesearch'] > 0: + explicit = "No" + + params['url'] = search_url.format(query=urlencode({'term': query, 'media': 'software', 'explicit': explicit})) return params