little changes

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

@ -8,10 +8,9 @@ from utils.console import print_markdown
from utils.console import print_step from utils.console import print_step
console = Console()
def setup(): def setup():
console = Console()
if exists(".setup-done-before"): if exists(".setup-done-before"):
console.log( console.log(
"[bold red]Setup was already done before! Please make" "[bold red]Setup was already done before! Please make"
@ -55,7 +54,7 @@ def setup():
theme = input("Theme? (light or dark) > ") theme = input("Theme? (light or dark) > ")
# you can also put a while loop here, e.g. while VideoIsBeingMade == True: ... # you can also put a while loop here, e.g. while VideoIsBeingMade == True: ...
console.log("[bold]Saving details...[/bold]") console.log("Saving credentials...")
os.remove(".env") os.remove(".env")
with open('.env', 'a', encoding="utf-8") as f: with open('.env', 'a', encoding="utf-8") as f:
f.write(f'REDDIT_CLIENT_ID="{cliID}"\n') f.write(f'REDDIT_CLIENT_ID="{cliID}"\n')

@ -16,22 +16,19 @@ import reddit.subreddit
from utils.console import print_step, print_substep from utils.console import print_step, print_substep
W, H = 1080, 1920
def make_final_video(number_of_clips, file_name): def make_final_video(number_of_clips, file_name):
load_dotenv() load_dotenv()
opacity = os.getenv("OPACITY") opacity = os.getenv("OPACITY")
print_step("Creating the final video...") print_step("Creating the final video...")
VideoFileClip.reW = lambda clip: clip.resize(width=W) VideoFileClip.reW = lambda clip: clip.resize(width=1080)
VideoFileClip.reH = lambda clip: clip.resize(width=H) VideoFileClip.reH = lambda clip: clip.resize(width=1920)
background_clip = ( background_clip = (
VideoFileClip("assets/mp4/clip.mp4") VideoFileClip("assets/mp4/clip.mp4")
.without_audio() .without_audio()
.resize(height=H) .resize(height=1920)
.crop(x1=1166.6, y1=0, x2=2246.6, y2=1920) .crop(x1=1166.6, y1=0, x2=2246.6, y2=1920)
) )
@ -72,7 +69,7 @@ def make_final_video(number_of_clips, file_name):
ImageClip(f"assets/png/title.png") ImageClip(f"assets/png/title.png")
.set_duration(audio_clips[0].duration + audio_clips[1].duration) .set_duration(audio_clips[0].duration + audio_clips[1].duration)
.set_position("center") .set_position("center")
.resize(width=W - 100) .resize(width=1080 - 100)
.set_opacity(float(opacity)), .set_opacity(float(opacity)),
) )
else: else:
@ -81,7 +78,7 @@ def make_final_video(number_of_clips, file_name):
ImageClip(f"assets/png/title.png") ImageClip(f"assets/png/title.png")
.set_duration(audio_clips[0].duration) .set_duration(audio_clips[0].duration)
.set_position("center") .set_position("center")
.resize(width=W - 100) .resize(width=1080 - 100)
.set_opacity(float(opacity)), .set_opacity(float(opacity)),
) )

@ -26,7 +26,7 @@ def save_text_to_mp3(reddit_obj):
try: try:
Path(f"assets/mp3/posttext.mp3").unlink() Path(f"assets/mp3/posttext.mp3").unlink()
except OSError as e: except OSError:
pass pass
if reddit_obj["thread_post"] != "": if reddit_obj["thread_post"] != "":

Loading…
Cancel
Save