From 306ae15596732d235b946e62632581331b567764 Mon Sep 17 00:00:00 2001 From: lilkitkat1 Date: Thu, 2 Jun 2022 18:33:37 +0200 Subject: [PATCH] ignore whitespaces --- video_creation/voices.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/video_creation/voices.py b/video_creation/voices.py index 14ca184..862d0f7 100644 --- a/video_creation/voices.py +++ b/video_creation/voices.py @@ -22,8 +22,10 @@ def get_accent(_in: str) -> str: "ireland": "ie", "south_africa": "co.za" } + if _in == "" or _in.isspace(): + return "co.uk" - return accents[_in.lower()] + return accents[_in.lower().replace(" ", "")] def save_text_to_mp3(reddit_obj): """Saves Text to MP3 files.