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
console = Console()
def setup():
console = Console()
if exists(".setup-done-before"):
console.log(
"[bold red]Setup was already done before! Please make"
@ -55,7 +54,7 @@ def setup():
theme = input("Theme? (light or dark) > ")
# 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")
with open('.env', 'a', encoding="utf-8") as f:
f.write(f'REDDIT_CLIENT_ID="{cliID}"\n')

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

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

Loading…
Cancel
Save