made it so that u can specify specify in .env file

pull/90/head
Viggo 3 years ago committed by GitHub
parent 1563a02ace
commit a66ca44184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,5 @@
REDDIT_CLIENT_ID="" REDDIT_CLIENT_ID=""
REDDIT_CLIENT_SECRET="" REDDIT_CLIENT_SECRET=""
REDDIT_USERNAME="" REDDIT_USERNAME=""
REDDIT_PASSWORD="" REDDIT_PASSWORD=""
VOICE=""

@ -3,7 +3,7 @@ from pathlib import Path
from mutagen.mp3 import MP3 from mutagen.mp3 import MP3
from utils.console import print_step, print_substep from utils.console import print_step, print_substep
from rich.progress import track from rich.progress import track
from sys import argv from os import getenv
def get_accent(_in: str) -> str: def get_accent(_in: str) -> str:
"""Returns the short version of an accent. """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. reddit_obj : The reddit object you received from the reddit API in the askreddit.py file.
""" """
try: try:
accent = get_accent(argv[1]) accent = get_accent(getenv("VOICE"))
# If no argument; set to default (co.uk)
except IndexError: except IndexError:
accent = "co.uk" accent = "co.uk"

Loading…
Cancel
Save