bug fixes and improvements

pull/280/head
iaacornus 3 years ago
parent 8e720d4e87
commit ed448130f1
No known key found for this signature in database
GPG Key ID: 281739AE7252598C

@ -56,8 +56,7 @@ def program_options():
try: try:
if args.create: if args.create:
trial = 0 while True:
while trial < 3:
create = main( create = main(
args.subreddit, args.subreddit,
args.background, args.background,
@ -68,7 +67,6 @@ def program_options():
if not create: if not create:
try_again = input("Something went wrong! Try again? [y/N] > ").strip() try_again = input("Something went wrong! Try again? [y/N] > ").strip()
if try_again in ["y", "Y"]: if try_again in ["y", "Y"]:
trial += 1
continue continue
break break

@ -10,7 +10,6 @@ from prawcore.exceptions import (
BadRequest BadRequest
) )
from dotenv import load_dotenv from dotenv import load_dotenv
from rich.console import Console
from utils.console import print_step, print_substep from utils.console import print_step, print_substep
@ -24,8 +23,6 @@ def get_subreddit_threads(subreddit_, thread_link_, number_of_comments):
Returns a list of threads from the AskReddit subreddit. Returns a list of threads from the AskReddit subreddit.
""" """
console = Console()
global submission global submission
load_dotenv() load_dotenv()
@ -54,11 +51,11 @@ def get_subreddit_threads(subreddit_, thread_link_, number_of_comments):
RequestException, RequestException,
BadRequest BadRequest
): ):
console.print( print_substep(
"[bold red]There is something wrong with the .env file, kindly check:[/bold red]\n" "[bold red]There is something wrong with the .env file, kindly check:[/bold red]\n"
+ "1. ClientID\n" + "1. ClientID\n"
+ "2. ClientSecret\n" + "2. ClientSecret\n"
+ "3. If these variables are fine, kindly check other variables." + "3. If these variables are fine, kindly check other variables.\n"
+ "4. Check if the type of Reddit app created is script (personal use script)." + "4. Check if the type of Reddit app created is script (personal use script)."
) )

@ -66,9 +66,9 @@ def download_background(background):
print_substep("Background video downloaded successfully!", style_="bold green") print_substep("Background video downloaded successfully!", style_="bold green")
cancel = False cancel = False
if cancel: if cancel:
# to prevent further error and processes from happening # to prevent further error and processes from happening
raise SystemExit() raise SystemExit()
def chop_background_video(video_length): def chop_background_video(video_length):

@ -18,7 +18,6 @@ from utils.console import print_step, print_substep
def make_final_video(number_of_clips, file_name): def make_final_video(number_of_clips, file_name):
load_dotenv() load_dotenv()
opacity = os.getenv("OPACITY")
print_step("Creating the final video...") print_step("Creating the final video...")

Loading…
Cancel
Save