From 421502b93b837556d593e0810abdc6d7eb3e29d3 Mon Sep 17 00:00:00 2001 From: William9923 Date: Wed, 29 Jun 2022 21:32:21 +0700 Subject: [PATCH 1/6] feat: screenshot position config & add download progress bar --- .env.template | 5 ++ main.py | 9 +-- video_creation/background.py | 109 ++++++++++++++++++++++++---------- video_creation/final_video.py | 51 ++++++++++------ 4 files changed, 121 insertions(+), 53 deletions(-) diff --git a/.env.template b/.env.template index 77f2acf..ce28209 100644 --- a/.env.template +++ b/.env.template @@ -81,6 +81,11 @@ AWS_VOICE="Joanna" TIKTOK_VOICE="en_us_006" #EXPLANATION Sets the voice for the TikTok TTS Engine. Check the file for more information on different voices. +#OPTIONAL +BackgroundChoice="minecraft" +#EXPLANATION Sets the background for the video. Current available option : (minecraft,gta,rocket-league,motor-gta), but you can add other video easily (1080p). Check the file for more information on different background. + #OPTIONAL STORYMODE="False" # IN-PROGRESS - not yet implemented + diff --git a/main.py b/main.py index e362aad..8d134a7 100755 --- a/main.py +++ b/main.py @@ -9,7 +9,7 @@ from utils.console import print_markdown, print_step from utils.checker import check_env # from utils.checker import envUpdate -from video_creation.background import download_background, chop_background_video +from video_creation.background import download_background, chop_background_video, get_background_config from video_creation.final_video import make_final_video from video_creation.screenshot_downloader import download_screenshots_of_reddit_posts from video_creation.voices import save_text_to_mp3 @@ -37,9 +37,10 @@ def main(POST_ID=None): length, number_of_comments = save_text_to_mp3(reddit_object) length = math.ceil(length) download_screenshots_of_reddit_posts(reddit_object, number_of_comments) - download_background() - chop_background_video(length) - make_final_video(number_of_comments, length, reddit_object) + bg_config = get_background_config() + download_background(bg_config) + chop_background_video(bg_config, length) + make_final_video(number_of_comments, length, reddit_object, bg_config) def run_many(times): diff --git a/video_creation/background.py b/video_creation/background.py index 2654499..62d1360 100644 --- a/video_creation/background.py +++ b/video_creation/background.py @@ -1,15 +1,53 @@ import random -from os import listdir, environ +from os import listdir, environ, getenv from pathlib import Path +import random from random import randrange -from typing import Tuple +from typing import Any, Tuple + +from dotenv import load_dotenv from moviepy.editor import VideoFileClip from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip from pytube import YouTube +from pytube.cli import on_progress from utils.console import print_step, print_substep +# Supported Background. Can add/remove background video here.... +# - : key -> used as keyword for .env file. value -> background configuration +# Format (value): +# 1. Youtube URI +# 2. filename +# 3. Citation (owner of the video) +# 4. Position of image clips in the background. See moviepy reference for more information. (https://zulko.github.io/moviepy/ref/VideoClip/VideoClip.html#moviepy.video.VideoClip.VideoClip.set_position) +background_options = { + "motor-gta": ( # Motor-GTA Racing + "https://www.youtube.com/watch?v=vw5L4xCPy9Q", + "bike-parkour-gta.mp4", + "Achy Gaming", + lambda t: ('center', 480 + t) + ), + "rocket-league": ( # Rocket League + "https://www.youtube.com/watch?v=2X9QGY__0II", + "rocket_league.mp4", + "Orbital Gameplay", + "top" + ), + "minecraft": ( # Minecraft parkour + "https://www.youtube.com/watch?v=n_Dv4JMiwK8", + "parkour.mp4", + "bbswitzer", + "center" + ), + "gta": ( # GTA Stunt Race + "https://www.youtube.com/watch?v=qGa9kWREOnE", + "gta-stunt-race.mp4", + "Achy Gaming", + lambda t: ('center', 480 + t) + ) +} + def get_start_and_end_times(video_length: int, length_of_clip: int) -> Tuple[int, int]: """Generates a random interval of time to be used as the background of the video. @@ -25,49 +63,58 @@ def get_start_and_end_times(video_length: int, length_of_clip: int) -> Tuple[int return random_time, random_time + video_length -def download_background(): - """Downloads the backgrounds/s video from YouTube.""" +def get_background_config(): + """Fetch the background/s configuration""" + load_dotenv() + try: + choice = getenv("BackgroundChoice").casefold() + except AttributeError: + print_substep("No background selected. Picking random background'") + choice = None + + # Handle default / not supported background using default option. + # Default : pick random from supported background. + if not choice or choice not in background_options: + choice = random.choice(list(background_options.keys())) + + return background_options[choice] + + +def download_background(background_config: Tuple[str, str, str, Any]): + """Downloads the background/s video from YouTube.""" Path("./assets/backgrounds/").mkdir(parents=True, exist_ok=True) - background_options = [ # uri , filename , credit - ("https://www.youtube.com/watch?v=n_Dv4JMiwK8", "parkour.mp4", "bbswitzer"), - # ( - # "https://www.youtube.com/watch?v=2X9QGY__0II", - # "rocket_league.mp4", - # "Orbital Gameplay", - # ), - ] # note: make sure the file name doesn't include an - in it - if not len(listdir("./assets/backgrounds")) >= len( - background_options - ): # if there are any background videos not installed - print_step( - "We need to download the backgrounds videos. they are fairly large but it's only done once. 😎" - ) - print_substep("Downloading the backgrounds videos... please be patient 🙏 ") - for uri, filename, credit in background_options: - if Path(f"assets/backgrounds/{credit}-{filename}").is_file(): - continue # adds check to see if file exists before downloading - print_substep(f"Downloading {filename} from {uri}") - YouTube(uri).streams.filter(res="1080p").first().download( - "assets/backgrounds", filename=f"{credit}-{filename}" - ) - - print_substep("Background videos downloaded successfully! 🎉", style="bold green") + uri, filename, credit, _ = background_config + if Path(f"assets/backgrounds/{credit}-{filename}").is_file(): + return + print_step( + "We need to download the backgrounds videos. they are fairly large but it's only done once. 😎" + ) + print_substep("Downloading the backgrounds videos... please be patient 🙏 ") + print_substep(f"Downloading {filename} from {uri}") + YouTube(uri, on_progress_callback=on_progress).streams.filter(res="1080p").first().download( + "assets/backgrounds", filename=f"{credit}-{filename}" + ) + print_substep("Background videos downloaded successfully! 🎉", + style="bold green") -def chop_background_video(video_length: int): +def chop_background_video(background_config: Tuple[str, str, str, Any], video_length: int): """Generates the background footage to be used in the video and writes it to assets/temp/background.mp4 Args: + background_config (Tuple[str, str, str, Any]) : Current background configuration video_length (int): Length of the clip where the background footage is to be taken out of """ + print_step("Finding a spot in the backgrounds video to chop...✂️") - choice = random.choice(listdir("assets/backgrounds")) + choice = f"{background_config[2]}-{background_config[1]}" environ["background_credit"] = choice.split("-")[0] background = VideoFileClip(f"assets/backgrounds/{choice}") - start_time, end_time = get_start_and_end_times(video_length, background.duration) + start_time, end_time = get_start_and_end_times( + video_length, background.duration) try: ffmpeg_extract_subclip( f"assets/backgrounds/{choice}", diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 84698c5..f2f12c8 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -4,6 +4,7 @@ import os import re from os.path import exists from typing import Dict +from typing import Tuple, Any from moviepy.editor import ( VideoFileClip, @@ -21,12 +22,13 @@ from utils.cleanup import cleanup from utils.console import print_step, print_substep from utils.videos import save_data + console = Console() W, H = 1080, 1920 -def make_final_video(number_of_clips: int, length: int, reddit_obj: dict): +def make_final_video(number_of_clips: int, length: int, reddit_obj: dict[str], background_config: Tuple[str, str, str, Any]): """Gathers audio clips, gathers all screenshots, stitches them together and saves the final video to assets/temp Args: @@ -55,26 +57,37 @@ def make_final_video(number_of_clips: int, length: int, reddit_obj: dict): # add title to video image_clips = [] # Gather all images - new_opacity = 1 if opacity is None or float(opacity) >= 1 else float(opacity) - - image_clips.insert( - 0, - ImageClip("assets/temp/png/title.png") - .set_duration(audio_clips[0].duration) - .set_position("center") - .resize(width=W - 100) - .set_opacity(new_opacity) - ) - - for i in range(0, number_of_clips): - image_clips.append( - ImageClip(f"assets/temp/png/comment_{i}.png") - .set_duration(audio_clips[i + 1].duration) - .set_position("center") + if opacity is None or float(opacity) >= 1: # opacity not set or is set to one OR MORE + image_clips.insert( + 0, + ImageClip("assets/temp/png/title.png") + .set_duration(audio_clips[0].duration) + .resize(width=W - 100), + ) + else: + image_clips.insert( + 0, + ImageClip("assets/temp/png/title.png") + .set_duration(audio_clips[0].duration) .resize(width=W - 100) .set_opacity(new_opacity) ) + for i in range(0, number_of_clips): + if opacity is None or float(opacity) >= 1: # opacity not set or is set to one OR MORE + image_clips.append( + ImageClip(f"assets/temp/png/comment_{i}.png") + .set_duration(audio_clips[i + 1].duration) + .resize(width=W - 100), + ) + else: + image_clips.append( + ImageClip(f"assets/temp/png/comment_{i}.png") + .set_duration(audio_clips[i + 1].duration) + .resize(width=W - 100) + .set_opacity(float(opacity)), + ) + # if os.path.exists("assets/mp3/posttext.mp3"): # image_clips.insert( # 0, @@ -85,7 +98,9 @@ def make_final_video(number_of_clips: int, length: int, reddit_obj: dict): # .set_opacity(float(opacity)), # ) # else: - image_concat = concatenate_videoclips(image_clips).set_position(("center", "center")) + img_clip_pos = background_config[3] + image_concat = concatenate_videoclips( + image_clips).set_position(img_clip_pos) image_concat.audio = audio_composite final = CompositeVideoClip([background_clip, image_concat]) title = re.sub(r"[^\w\s-]", "", reddit_obj["thread_title"]) From 248010df9e7815b5bfae3cfc1be1dadeebf01a73 Mon Sep 17 00:00:00 2001 From: CordlessCoder <42666308+CordlessCoder@users.noreply.github.com> Date: Sun, 3 Jul 2022 17:39:30 +0300 Subject: [PATCH 2/6] Update .env.template --- .env.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.template b/.env.template index ce28209..1cb62cb 100644 --- a/.env.template +++ b/.env.template @@ -83,7 +83,7 @@ TIKTOK_VOICE="en_us_006" #OPTIONAL BackgroundChoice="minecraft" -#EXPLANATION Sets the background for the video. Current available option : (minecraft,gta,rocket-league,motor-gta), but you can add other video easily (1080p). Check the file for more information on different background. +# EXPLANATION Sets the background for the video. Current available option : (minecraft,gta,rocket-league,motor-gta), but you can add other video easily (1080p). Check the file for more information on different background. #OPTIONAL STORYMODE="False" From 59d07f51c8719dc088313b55f263dc1bea19ecce Mon Sep 17 00:00:00 2001 From: William9923 Date: Mon, 4 Jul 2022 04:34:08 +0700 Subject: [PATCH 3/6] chore: fixup changes after rebase --- video_creation/final_video.py | 43 ++++++++++++----------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index f2f12c8..428dd67 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -3,7 +3,6 @@ import multiprocessing import os import re from os.path import exists -from typing import Dict from typing import Tuple, Any from moviepy.editor import ( @@ -28,7 +27,7 @@ console = Console() W, H = 1080, 1920 -def make_final_video(number_of_clips: int, length: int, reddit_obj: dict[str], background_config: Tuple[str, str, str, Any]): +def make_final_video(number_of_clips: int, length: int, reddit_obj: dict, background_config: Tuple[str, str, str, Any]): """Gathers audio clips, gathers all screenshots, stitches them together and saves the final video to assets/temp Args: @@ -57,37 +56,23 @@ def make_final_video(number_of_clips: int, length: int, reddit_obj: dict[str], b # add title to video image_clips = [] # Gather all images - if opacity is None or float(opacity) >= 1: # opacity not set or is set to one OR MORE - image_clips.insert( - 0, - ImageClip("assets/temp/png/title.png") - .set_duration(audio_clips[0].duration) - .resize(width=W - 100), - ) - else: - image_clips.insert( - 0, - ImageClip("assets/temp/png/title.png") - .set_duration(audio_clips[0].duration) + new_opacity = 1 if opacity is None or float(opacity) >= 1 else float(opacity) + image_clips.insert( + 0, + ImageClip("assets/temp/png/title.png") + .set_duration(audio_clips[0].duration) + .resize(width=W - 100) + .set_opacity(new_opacity) + ) + + for i in range(0, number_of_clips): + image_clips.append( + ImageClip(f"assets/temp/png/comment_{i}.png") + .set_duration(audio_clips[i + 1].duration) .resize(width=W - 100) .set_opacity(new_opacity) ) - for i in range(0, number_of_clips): - if opacity is None or float(opacity) >= 1: # opacity not set or is set to one OR MORE - image_clips.append( - ImageClip(f"assets/temp/png/comment_{i}.png") - .set_duration(audio_clips[i + 1].duration) - .resize(width=W - 100), - ) - else: - image_clips.append( - ImageClip(f"assets/temp/png/comment_{i}.png") - .set_duration(audio_clips[i + 1].duration) - .resize(width=W - 100) - .set_opacity(float(opacity)), - ) - # if os.path.exists("assets/mp3/posttext.mp3"): # image_clips.insert( # 0, From a9f0449ddd1408ff90f683190b8d298d2016f826 Mon Sep 17 00:00:00 2001 From: Jason <66544866+JasonLovesDoggo@users.noreply.github.com> Date: Wed, 6 Jul 2022 22:26:06 -0400 Subject: [PATCH 4/6] Delete .env.template --- .env.template | 91 --------------------------------------------------- 1 file changed, 91 deletions(-) delete mode 100644 .env.template diff --git a/.env.template b/.env.template deleted file mode 100644 index 1cb62cb..0000000 --- a/.env.template +++ /dev/null @@ -1,91 +0,0 @@ - -REDDIT_CLIENT_ID="" #fFAGRNJru1FTz70BzhT3Zg -#EXPLANATION the ID of your Reddit app of SCRIPT type -#RANGE 12:30 -#MATCH_REGEX [-a-zA-Z0-9._~+/]+=*$ -#OOB_ERROR The ID should be over 12 and under 30 characters, double check your input. - -REDDIT_CLIENT_SECRET="" #fFAGRNJru1FTz70BzhT3Zg -#EXPLANATION the SECRET of your Reddit app of SCRIPT type -#RANGE 20:40 -#MATCH_REGEX [-a-zA-Z0-9._~+/]+=*$ -#OOB_ERROR The secret should be over 20 and under 40 characters, double check your input. - -REDDIT_USERNAME="" #asdfghjkl -#EXPLANATION the username of your reddit account -#RANGE 3:20 -#MATCH_REGEX [-_0-9a-zA-Z]+$ -#OOB_ERROR A username HAS to be between 3 and 20 characters - -REDDIT_PASSWORD="" #fFAGRNJru1FTz70BzhT3Zg -#EXPLANATION the password of your reddit account -#RANGE 8:None -#OOB_ERROR Password too short - -#OPTIONAL -RANDOM_THREAD="no" -# If set to no, it will ask you a thread link to extract the thread, if yes it will randomize it. Default: "no" - -REDDIT_2FA="" #no -#MATCH_REGEX ^(yes|no) -#EXPLANATION Whether you have Reddit 2FA enabled, Valid options are "yes" and "no" - -SUBREDDIT="AskReddit" -#EXPLANATION what subreddit to pull posts from, the name of the sub, not the URL -#RANGE 3:20 -#MATCH_REGEX [_0-9a-zA-Z]+$ -#OOB_ERROR A subreddit name HAS to be between 3 and 20 characters - -ALLOW_NSFW="False" -#EXPLANATION Whether to allow NSFW content, True or False -#MATCH_REGEX ^(True|False)$ - -POST_ID="" -#MATCH_REGEX ^((?!://|://).)*$ -#EXPLANATION Used if you want to use a specific post. example of one is urdtfx - -THEME="LIGHT" #dark -#EXPLANATION sets the Reddit theme, either LIGHT or DARK -#MATCH_REGEX ^(dark|light|DARK|LIGHT)$ - -TIMES_TO_RUN="" #2 -#EXPLANATION used if you want to run multiple times. set to an int e.g. 4 or 29 and leave blank for 1 - -MAX_COMMENT_LENGTH="500" #500 -#EXPLANATION max number of characters a comment can have. default is 500 -#RANGE 0:10000 -#MATCH_TYPE int -#OOB_ERROR the max comment length should be between 0 and 10000 - -OPACITY="1" #.8 -#EXPLANATION Sets the opacity of the comments when overlayed over the background -#RANGE 0:1 -#MATCH_TYPE float -#OOB_ERROR The opacity HAS to be between 0 and 1 - -# If you want to translate the comments to another language, set the language code here. -# If empty, no translation will be done. -POSTLANG="" -#EXPLANATION Activates the translation feature, set the language code for translate or leave blank - -TTSCHOICE="Polly" -#EXPLANATION the backend used for TTS. Without anything specified, the user will be prompted to choose one. -# IMPORTANT NOTE: if you use translate, you need to set this to googletranslate or tiktok and use custom voice in your language - -STREAMLABS_VOICE="Joanna" -#EXPLANATION Sets the voice for the Streamlabs Polly TTS Engine. Check the file for more information on different voices. - -AWS_VOICE="Joanna" -#EXPLANATION Sets the voice for the AWS Polly TTS Engine. Check the file for more information on different voices. - -TIKTOK_VOICE="en_us_006" -#EXPLANATION Sets the voice for the TikTok TTS Engine. Check the file for more information on different voices. - -#OPTIONAL -BackgroundChoice="minecraft" -# EXPLANATION Sets the background for the video. Current available option : (minecraft,gta,rocket-league,motor-gta), but you can add other video easily (1080p). Check the file for more information on different background. - -#OPTIONAL -STORYMODE="False" -# IN-PROGRESS - not yet implemented - From 9ae01b7c1947caa5044a0acce3f640bee4716c9e Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 6 Jul 2022 23:15:56 -0400 Subject: [PATCH 5/6] fixed merge conflicts and cleared up some old existing .env referances chore: updated version num style: improved IDE autocorrection support chore: simplified the regex in func name_normalize --- TTS/aws_polly.py | 2 +- TTS/streamlabs_polly.py | 2 +- main.py | 2 +- utils/videos.py | 4 ++-- video_creation/background.py | 25 ++----------------------- video_creation/final_video.py | 6 +++--- 6 files changed, 10 insertions(+), 31 deletions(-) diff --git a/TTS/aws_polly.py b/TTS/aws_polly.py index bf8ec1e..0ff0d74 100644 --- a/TTS/aws_polly.py +++ b/TTS/aws_polly.py @@ -37,7 +37,7 @@ class AWSPolly: else: if not settings.config["settings"]["tts"]["aws_polly_voice"]: return ValueError( - f"Please set the environment variable AWS_VOICE to a valid voice. options are: {voices}" + f"Please set the TOML variable AWS_VOICE to a valid voice. options are: {voices}" ) voice = str( settings.config["settings"]["tts"]["aws_polly_voice"] diff --git a/TTS/streamlabs_polly.py b/TTS/streamlabs_polly.py index e9e6358..d4ddcb4 100644 --- a/TTS/streamlabs_polly.py +++ b/TTS/streamlabs_polly.py @@ -37,7 +37,7 @@ class StreamlabsPolly: else: if not settings.config["settings"]["tts"]["streamlabs_polly_voice"]: return ValueError( - f"Please set the environment variable STREAMLABS_VOICE to a valid voice. options are: {voices}" + f"Please set the config variable STREAMLABS_VOICE to a valid voice. options are: {voices}" ) voice = str( settings.config["settings"]["tts"]["streamlabs_polly_voice"] diff --git a/main.py b/main.py index 91d9e56..622cd2e 100755 --- a/main.py +++ b/main.py @@ -13,7 +13,7 @@ from video_creation.final_video import make_final_video from video_creation.screenshot_downloader import download_screenshots_of_reddit_posts from video_creation.voices import save_text_to_mp3 -VERSION = "2.2.8" +VERSION = "2.2.9" print( """ ██████╗ ███████╗██████╗ ██████╗ ██╗████████╗ ██╗ ██╗██╗██████╗ ███████╗ ██████╗ ███╗ ███╗ █████╗ ██╗ ██╗███████╗██████╗ diff --git a/utils/videos.py b/utils/videos.py index 4e36729..51143c3 100755 --- a/utils/videos.py +++ b/utils/videos.py @@ -28,7 +28,7 @@ def check_done( if video["id"] == str(redditobj): if settings.config["reddit"]["thread"]["post_id"]: print_step( - "You already have done this video but since it was declared specifically in the .env file the program will continue" + "You already have done this video but since it was declared specifically in the config file the program will continue" ) return redditobj print_step("Getting new post as the current one has already been done") @@ -48,7 +48,7 @@ def save_data(filename: str, reddit_title: str, reddit_id: str, credit: str): with open("./video_creation/data/videos.json", "r+", encoding="utf-8") as raw_vids: done_vids = json.load(raw_vids) if reddit_id in [video["id"] for video in done_vids]: - return # video already done but was specified to continue anyway in the .env file + return # video already done but was specified to continue anyway in the config file payload = { "id": reddit_id, "time": str(int(time.time())), diff --git a/video_creation/background.py b/video_creation/background.py index 4044f15..d9dc056 100644 --- a/video_creation/background.py +++ b/video_creation/background.py @@ -1,11 +1,8 @@ -import random -from os import listdir from pathlib import Path import random from random import randrange from typing import Any, Tuple -from dotenv import load_dotenv from moviepy.editor import VideoFileClip from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip @@ -48,21 +45,7 @@ background_options = { lambda t: ('center', 480 + t) ) } -def get_background_config(): - """Fetch the background/s configuration""" - try: - choice = str(settings.config['settings']['background_choice']).casefold() - except AttributeError: - print_substep("No background selected. Picking random background'") - choice = None - # Handle default / not supported background using default option. - # Default : pick random from supported background. - if not choice or choice not in background_options: - choice = random.choice(list(background_options.keys())) - - return background_options[choice] - def get_start_and_end_times(video_length: int, length_of_clip: int) -> Tuple[int, int]: """Generates a random interval of time to be used as the background of the video. @@ -76,12 +59,10 @@ def get_start_and_end_times(video_length: int, length_of_clip: int) -> Tuple[int random_time = randrange(180, int(length_of_clip) - int(video_length)) return random_time, random_time + video_length - def get_background_config(): """Fetch the background/s configuration""" - load_dotenv() try: - choice = getenv("BackgroundChoice").casefold() + choice = str(settings.config['settings']['background_choice']).casefold() except AttributeError: print_substep("No background selected. Picking random background'") choice = None @@ -123,8 +104,6 @@ def chop_background_video(background_config: Tuple[str, str, str, Any], video_le print_step("Finding a spot in the backgrounds video to chop...✂️") choice = f"{background_config[2]}-{background_config[1]}" - environ["background_credit"] = choice.split("-")[0] - background = VideoFileClip(f"assets/backgrounds/{choice}") @@ -143,4 +122,4 @@ def chop_background_video(background_config: Tuple[str, str, str, Any], video_le new = video.subclip(start_time, end_time) new.write_videofile("assets/temp/background.mp4") print_substep("Background video chopped successfully!", style="bold green") - return credit + return background_config[2] diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 1035483..ebdf4d0 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -49,10 +49,10 @@ def name_normalize(name: str) -> str: def make_final_video(number_of_clips: int, length: int, reddit_obj: dict, background_config: Tuple[str, str, str, Any]): """Gathers audio clips, gathers all screenshots, stitches them together and saves the final video to assets/temp Args: - number_of_clips (int): Index to end at when going through the screenshots + number_of_clips (int): Index to end at when going through the screenshots' length (int): Length of the video reddit_obj (dict): The reddit object that contains the posts to read. - background_config Tuple[str, str, str, Any]: The background config to use. + background_config (Tuple[str, str, str, Any]): The background config to use. """ print_step("Creating the final video 🎥") VideoFileClip.reW = lambda clip: clip.resize(width=W) @@ -103,7 +103,7 @@ def make_final_video(number_of_clips: int, length: int, reddit_obj: dict, backgr # .resize(width=W - 100) # .set_opacity(float(opacity)), # ) - # else: + # else: story mode stuff img_clip_pos = background_config[3] image_concat = concatenate_videoclips( image_clips).set_position(img_clip_pos) From c22856271c632d0778f43c0734972e4249374b4c Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 6 Jul 2022 23:32:30 -0400 Subject: [PATCH 6/6] fix: removed duplicate func call docs: added verq to the devs --- README.md | 6 ++---- main.py | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7f10287..af01afe 100644 --- a/README.md +++ b/README.md @@ -75,12 +75,10 @@ Please read our [contributing guidelines](CONTRIBUTING.md) for more detailed inf Elebumm (Lewis#6305) - https://github.com/elebumm (Founder) -Jason (JasonLovesDoggo#1904) - https://github.com/JasonLovesDoggo +Jason (JasonLovesDoggo#1904) - https://github.com/JasonLovesDoggo (Maintainer) CallumIO (c.#6837) - https://github.com/CallumIO -HarryDaDev (hrvyy#9677) - https://github.com/ImmaHarry +Verq (Verq#2338) - https://github.com/CordlessCoder LukaHietala (Pix.#0001) - https://github.com/LukaHietala - -Freebiell (Freebie#6429) - https://github.com/FreebieII diff --git a/main.py b/main.py index 622cd2e..cefb74d 100755 --- a/main.py +++ b/main.py @@ -36,7 +36,6 @@ def main(POST_ID=None): reddit_object = get_subreddit_threads(POST_ID) length, number_of_comments = save_text_to_mp3(reddit_object) length = math.ceil(length) - bg_config = get_background_config() download_screenshots_of_reddit_posts(reddit_object, number_of_comments) bg_config = get_background_config() download_background(bg_config)