diff --git a/build.sh b/build.sh index 7d4dfc6..165357f 100755 --- a/build.sh +++ b/build.sh @@ -1 +1 @@ -docker build -t rvmt . \ No newline at end of file +docker build -t rvmt . diff --git a/run.sh b/run.sh index 4dcb69a..1f86c99 100755 --- a/run.sh +++ b/run.sh @@ -1 +1 @@ -docker run -v $(pwd)/out/:/app/assets -v $(pwd)/.env:/app/.env -it rvmt \ No newline at end of file +docker run -v $(pwd)/out/:/app/assets -v $(pwd)/.env:/app/.env -it rvmt diff --git a/setup_program.py b/setup_program.py index 67346e7..924c34e 100644 --- a/setup_program.py +++ b/setup_program.py @@ -1,11 +1,9 @@ -# Imports import os from os.path import exists from rich.console import Console from utils.console import print_markdown -from utils.console import print_step def setup(): diff --git a/video_creation/voices.py b/video_creation/voices.py index 0889ac6..f8b304e 100644 --- a/video_creation/voices.py +++ b/video_creation/voices.py @@ -3,6 +3,7 @@ from pathlib import Path from gtts import gTTS from mutagen.mp3 import MP3 from rich.progress import track +import re from utils.console import print_step, print_substep @@ -39,7 +40,9 @@ def save_text_to_mp3(reddit_obj): # ! This can be longer, but this is just a good starting point if length > 50: break - tts = gTTS(text=comment["comment_body"], lang="en", slow=False) + comment=comment["comment_body"] + text=re.sub('((http|https)\:\/\/)?[a-zA-Z0-9\.\/\?\:@\-_=#]+\.([a-zA-Z]){2,6}([a-zA-Z0-9\.\&\/\?\:@\-_=#])*', '', comment) + tts = gTTS(text, lang="en", slow=False) tts.save(f"assets/mp3/{idx}.mp3") length += MP3(f"assets/mp3/{idx}.mp3").info.length