HOLY SHITNUGGIES IT WORKS!

pull/418/head
Jason 3 years ago
parent 55d8145d70
commit 81e8a5d6fb

@ -7,9 +7,9 @@ from video_creation.voices import save_text_to_mp3
from video_creation.screenshot_downloader import download_screenshots_of_reddit_posts from video_creation.screenshot_downloader import download_screenshots_of_reddit_posts
from video_creation.final_video import make_final_video from video_creation.final_video import make_final_video
# base code by elebumm
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." "### Thanks for using this tool! 😊 Feel free to contribute to this project on GitHub! (JasonLovesDoggo/RedditVideoMakerBot). If you have any questions, feel free to reach out to me on Twitter or submit a GitHub issue.")
)
time.sleep(2) time.sleep(2)

@ -25,9 +25,9 @@ def download_background():
background_options = [ # uri , filename , credit background_options = [ # uri , filename , credit
("https://www.youtube.com/watch?v=n_Dv4JMiwK8", "parkour.mp4", 'bbswitzer'), ("https://www.youtube.com/watch?v=n_Dv4JMiwK8", "parkour.mp4", 'bbswitzer'),
("https://www.youtube.com/watch?v=2X9QGY__0II", "rocket_league.mp4", 'Orbital Gameplay'), ] ("https://www.youtube.com/watch?v=2X9QGY__0II", "rocket_league.mp4", 'Orbital Gameplay'), ]
# note: make sure the file name doesn't include a - in it # note: make sure the file name doesn't include a - in it
print(listdir('./assets/backgrounds'), 'podsods', len(background_options)) if len(listdir('./assets/backgrounds')) != len(
if listdir('./assets/backgrounds') != len(background_options): background_options): # if there are any background videos not installed
print_step("We need to download the backgnrounds videos. they are fairly large but it's only done once. 😎") print_step("We need to download the backgnrounds videos. they are fairly large but it's only done once. 😎")
print_substep("Downloading the backgrounds videos... please be patient 🙏 ") print_substep("Downloading the backgrounds videos... please be patient 🙏 ")
with Progress() as progress: with Progress() as progress:

@ -1,5 +1,7 @@
import sox import sox
from pathlib import Path from pathlib import Path
from mutagen import MutagenError
from mutagen.mp3 import MP3, HeaderNotFoundError from mutagen.mp3 import MP3, HeaderNotFoundError
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
@ -34,7 +36,7 @@ def save_text_to_mp3(reddit_obj):
ttttsw.tts(comment["comment_body"], filename=f"assets/temp/mp3/{idx}.mp3", random_speaker=False) ttttsw.tts(comment["comment_body"], filename=f"assets/temp/mp3/{idx}.mp3", random_speaker=False)
try: try:
length += MP3(f"assets/temp/mp3/{idx}.mp3").info.length length += MP3(f"assets/temp/mp3/{idx}.mp3").info.length
except HeaderNotFoundError: except HeaderNotFoundError or MutagenError:
length = sox.file_info.duration(f"assets/temp/mp3/{idx}.mp3") length = sox.file_info.duration(f"assets/temp/mp3/{idx}.mp3")
print_substep("Saved Text to MP3 files Successfully.", style="bold green") print_substep("Saved Text to MP3 files Successfully.", style="bold green")

Loading…
Cancel
Save