diff --git a/.env.template b/.env.template index e00c242..137cea1 100644 --- a/.env.template +++ b/.env.template @@ -1,4 +1,5 @@ REDDIT_CLIENT_ID="" REDDIT_CLIENT_SECRET="" REDDIT_USERNAME="" -REDDIT_PASSWORD="" \ No newline at end of file +REDDIT_PASSWORD="" +VOICE="" \ No newline at end of file diff --git a/video_creation/voices.py b/video_creation/voices.py index 42978e4..14ca184 100644 --- a/video_creation/voices.py +++ b/video_creation/voices.py @@ -3,7 +3,7 @@ from pathlib import Path from mutagen.mp3 import MP3 from utils.console import print_step, print_substep from rich.progress import track -from sys import argv +from os import getenv def get_accent(_in: str) -> str: """Returns the short version of an accent. @@ -32,8 +32,7 @@ def save_text_to_mp3(reddit_obj): reddit_obj : The reddit object you received from the reddit API in the askreddit.py file. """ try: - accent = get_accent(argv[1]) - # If no argument; set to default (co.uk) + accent = get_accent(getenv("VOICE")) except IndexError: accent = "co.uk"