diff --git a/TTS/engine_wrapper.py b/TTS/engine_wrapper.py index 9cf567a..d611a0c 100644 --- a/TTS/engine_wrapper.py +++ b/TTS/engine_wrapper.py @@ -18,7 +18,7 @@ from utils import settings from utils.console import print_step, print_substep from utils.voice import sanitize_text -DEFAULT_MAX_LENGTH: int = 40 # video length variable +DEFAULT_MAX_LENGTH: int = 50 # video length variable class TTSEngine: @@ -61,12 +61,12 @@ class TTSEngine: idx = None if settings.config["settings"]["storymode"] : - if settings.config["settings"]["storymodemethode"] == 0: + if settings.config["settings"]["storymodemethod"] == 0: if (len(self.reddit_object["thread_post"]) > self.tts_module.max_chars): self.split_post(self.reddit_object["thread_post"], "postaudio") else : self.call_tts("postaudio",process_text(self.reddit_object["thread_post"]) ) - elif settings.config["settings"]["storymodemethode"] == 1: + elif settings.config["settings"]["storymodemethod"] == 1: for idx,text in enumerate(self.reddit_object["thread_post"]): self.call_tts(f"posttext-{idx}",process_text(text) ) diff --git a/reddit/subreddit.py b/reddit/subreddit.py index 5f594a0..fa10abc 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -95,7 +95,7 @@ def get_subreddit_threads(POST_ID: str): content["thread_id"] = submission.id content["comments"] = [] if settings.config["settings"]["storymode"]: - if settings.config["settings"]["storymodemethode"] == 1: + if settings.config["settings"]["storymodemethod"] == 1: content["thread_post"] = posttextparser(submission.selftext) else: content["thread_post"] =submission.selftext diff --git a/utils/.config.template.toml b/utils/.config.template.toml index 139b729..0a28b02 100644 --- a/utils/.config.template.toml +++ b/utils/.config.template.toml @@ -23,7 +23,7 @@ times_to_run = { optional = false, default = 1, example = 2, explanation = "Used opacity = { optional = false, default = 0.9, example = 0.8, explanation = "Sets the opacity of the comments when overlayed over the background", type = "float", nmin = 0, nmax = 1, oob_error = "The opacity HAS to be between 0 and 1", input_error = "The opacity HAS to be a decimal number between 0 and 1" } transition = { optional = true, default = 0.2, example = 0.2, explanation = "Sets the transition time (in seconds) between the comments. Set to 0 if you want to disable it.", type = "float", nmin = 0, nmax = 2, oob_error = "The transition HAS to be between 0 and 2", input_error = "The opacity HAS to be a decimal number between 0 and 2" } storymode = { optional = true, type = "bool", default = false, example = false, options = [true, false,], explanation = "Only read out title and post content, not yet implemented" } -storymodemethode= { optional = true, default = 1, example = 1, explanation = "Method to for storymode. Set to an int e.g.0 or 1", type = "int", nmin = 0, oob_error = "It's very hard to run something less than once." } +storymodemethod= { optional = true, default = 1, example = 1, explanation = "style of video for storymode. Set to an 0 for single picture display in whole video set 1 for fancy looking video ", type = "int", nmin = 0, oob_error = "It's very hard to run something less than once." } [settings.background] diff --git a/video_creation/final_video.py b/video_creation/final_video.py index a603a6f..1824ce1 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -78,10 +78,10 @@ def make_final_video( # Gather all audio clips if settings.config["settings"]["storymode"]: - if settings.config["settings"]["storymodemethode"] == 0: + if settings.config["settings"]["storymodemethod"] == 0: audio_clips = [AudioFileClip(f"assets/temp/{id}/mp3/title.mp3")] audio_clips.insert(1,AudioFileClip(f"assets/temp/{id}/mp3/postaudio.mp3")) - elif settings.config["settings"]["storymodemethode"] == 1: + elif settings.config["settings"]["storymodemethod"] == 1: #here work is not done14 audio_clips = [AudioFileClip(f"assets/temp/{id}/mp3/posttext-{i}.mp3") for i in range(number_of_clips+1)] audio_clips.insert(0, AudioFileClip(f"assets/temp/{id}/mp3/title.mp3")) @@ -108,7 +108,7 @@ def make_final_video( .crossfadeout(new_transition), ) if settings.config["settings"]["storymode"]: - if settings.config["settings"]["storymodemethode"] == 0: + if settings.config["settings"]["storymodemethod"] == 0: if os.path.exists(f"assets/temp/{id}/png/story_content.png"):# else: story mode stuff image_clips.insert( 1, @@ -118,7 +118,7 @@ def make_final_video( .resize(width=W - 100) .set_opacity(float(opacity)), ) - elif settings.config["settings"]["storymodemethode"] == 1: + elif settings.config["settings"]["storymodemethod"] == 1: for i in range(0, number_of_clips+1): image_clips.append( ImageClip(f"assets/temp/{id}/png/img{i}.png") diff --git a/video_creation/screenshot_downloader.py b/video_creation/screenshot_downloader.py index 04e1cba..2ba5f28 100644 --- a/video_creation/screenshot_downloader.py +++ b/video_creation/screenshot_downloader.py @@ -7,6 +7,7 @@ import translators as ts from playwright.sync_api import sync_playwright, ViewportSize from rich.progress import track import translators as ts +from utils import settings from utils.imagenarator import imagemaker from utils.console import print_step, print_substep @@ -69,14 +70,14 @@ def download_screenshots_of_reddit_posts(reddit_object: dict, screenshot_num: in page.locator('[data-test-id="post-content"]').screenshot(path=postcontentpath) if settings.config["settings"]["storymode"] == True: - if settings.config["settings"]["storymodemethode"] == 0: + if settings.config["settings"]["storymodemethod"] == 0: try : #new change page.locator('[data-click-id="text"]').first.screenshot( path=f"assets/temp/{id}/png/story_content.png" ) except: exit - elif settings.config["settings"]["storymodemethode"] == 1: + elif settings.config["settings"]["storymodemethod"] == 1: for idx,item in enumerate(reddit_object["thread_post"]): imagemaker(item,idx=idx,reddit_obj=reddit_object)