diff --git a/main.py b/main.py index 3bffbed..1496aa6 100644 --- a/main.py +++ b/main.py @@ -3,7 +3,6 @@ import time from dotenv import load_dotenv - from reddit.subreddit import get_subreddit_threads from video_creation.background import download_background, chop_background_video from video_creation.voices import save_text_to_mp3 @@ -12,17 +11,20 @@ from video_creation.final_video import make_final_video from utils.console import print_markdown -print_markdown( - "### Thanks for using this tool! [Feel free to contribute to this project on GitHub!](https://lewismenelaws.com) If you have any questions, feel free to reach out to me on Twitter or submit a GitHub issue." -) +def main(): + print_markdown( + "### Thanks for using this tool! [Feel free to contribute to this project on " + + "GitHub!](https://lewismenelaws.com) If you have any questions, feel free to" + + "reach out to me on Twitter or submit a GitHub issue." + ) -time.sleep(3) + time.sleep(3) -reddit_object = get_subreddit_threads() + reddit_object = get_subreddit_threads() -load_dotenv() -length, number_of_comments = save_text_to_mp3(reddit_object) -download_screenshots_of_reddit_posts(reddit_object, number_of_comments, os.getenv("THEME")) -download_background() -chop_background_video(length) -final_video = make_final_video(number_of_comments) + load_dotenv() + length, number_of_comments = save_text_to_mp3(reddit_object) + download_screenshots_of_reddit_posts(reddit_object, number_of_comments, os.getenv("THEME")) + download_background() + chop_background_video(length) + final_video = make_final_video(number_of_comments) diff --git a/utils/console.py b/utils/console.py index b565737..6540732 100644 --- a/utils/console.py +++ b/utils/console.py @@ -22,6 +22,6 @@ def print_step(text): console.print(panel) -def print_substep(text, style=""): +def print_substep(text, style_): """Prints a rich info message without the panelling.""" - console.print(text, style=style) + console.print(text, style=style_) diff --git a/video_creation/background.py b/video_creation/background.py index 69d8709..fd53c04 100644 --- a/video_creation/background.py +++ b/video_creation/background.py @@ -2,9 +2,9 @@ from random import randrange from pathlib import Path from yt_dlp import YoutubeDL - from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip from moviepy.editor import VideoFileClip + from utils.console import print_step, print_substep