fixes and turned main.py into function for use in cli.py

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

@ -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)

@ -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_)

@ -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

Loading…
Cancel
Save