diff --git a/database_caller.py b/database_caller.py index daa21c1..36e2e22 100755 --- a/database_caller.py +++ b/database_caller.py @@ -817,7 +817,7 @@ def updateJokes(api_key, logf): with open('csv/jokes_settings.json', 'r') as f: jokes_settings = json.load(f) except: - jokes_settings = {"feature": "Jokes", "speed": "medium", "speed2": "medium", "animation": "up", "title": true, "categories": ["Any"], "blacklist": [], "amount": "5", "jokes": []} + jokes_settings = {"feature": "Jokes", "speed": "medium", "speed2": "medium", "animation": "up", "title": True, "safe": True, "categories": ["Any"], "blacklist": [], "amount": "5", "jokes": []} try: if 'Any' in jokes_settings['categories']: categories = 'Any' @@ -830,6 +830,8 @@ def updateJokes(api_key, logf): joke_url = 'https://v2.jokeapi.dev/joke/'+categories+'?amount='+amount if blacklist != '': joke_url = 'https://v2.jokeapi.dev/joke/'+categories+ '?blacklistFlags=' + blacklist + '&amount='+amount + if jokes_settings['safe']: + joke_url += '&safe-mode' get_jokes = requests.get(joke_url) all_jokes = get_jokes.json()