fixed the merge changes

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

@ -26,6 +26,26 @@ def main(
required variables are set. If not, print a warning and launch the
setup wizard.
"""
# Banner may look bad or wrong in IDE/Text Editor, but looks perfect in CMD, BASH or ZSH
banner = """
"""
print(banner)
load_dotenv()
REQUIRED_VALUES = [

@ -20,7 +20,7 @@ def get_subreddit_threads(subreddit_, thread_link_, number_of_comments):
case since it is None, it would raise ValueError, thus defaulting
to AskReddit.
Returns a list of threads from the AskReddit subreddit.
Returns a list of threads from the provided subreddit.
"""
global submission
@ -105,7 +105,16 @@ def get_subreddit_threads(subreddit_, thread_link_, number_of_comments):
"The thread do not contain any comments. Searching for new one.", style_="bold"
)
print_substep(f"Video will be: [cyan]{submission.title}[/cyan] :thumbsup:")
upvotes = submission.score
ratio = submission.upvote_ratio * 100
num_comments = submission.num_comments
print_substep(
f"[bold]Video will be: [cyan]{submission.title}[/cyan] :thumbsup:\n"
+ f"[blue] Thread has {upvotes} and upvote ratio of {ratio}%\n"
+ f"And has a {num_comments}[/blue].\n"
)
try:
content["thread_url"] = submission.url

@ -9,6 +9,8 @@ from moviepy.editor import VideoFileClip
from utils.console import print_step, print_substep
import datetime
def get_start_and_end_times(video_length, length_of_clip):
random_time = randrange(180, int(length_of_clip) - int(video_length))
@ -71,13 +73,16 @@ def download_background(background):
raise SystemExit()
def chop_background_video(video_length):
def chop_background_video(video_length, vidpath):
print_step("Finding a spot in the background video to chop...")
background = VideoFileClip("assets/mp4/background.mp4")
background = VideoFileClip(f"assets/mp4/{vidpath}.mp4")
if background.duration < video_length + 180:
print_substep("This video is too short.", style="red")
noerror = False
return noerror
start_time, end_time = get_start_and_end_times(video_length, background.duration)
ffmpeg_extract_subclip(
"assets/mp4/background.mp4",
f"assets/mp4/{vidpath}.mp4",
start_time,
end_time,
targetname="assets/mp4/clip.mp4",

@ -7,7 +7,6 @@ from rich.progress import track
from utils.console import print_step, print_substep
def save_text_to_mp3(reddit_obj):
"""Saves Text to MP3 files.

Loading…
Cancel
Save