From a66ca441841419fe94fc37264fb0b132cda6485d Mon Sep 17 00:00:00 2001 From: Viggo <53278263+lilkitkat1@users.noreply.github.com> Date: Thu, 2 Jun 2022 08:17:17 +0200 Subject: [PATCH] made it so that u can specify specify in .env file --- .env.template | 3 ++- video_creation/voices.py | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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"