Changed reqs

pull/2058/head
Mohamed Moataz 1 year ago
parent 5755e0792b
commit 4456777f75

@ -1,5 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
import math import math
import os
import shutil
import time import time
import schedule import schedule
import sys import sys
@ -53,6 +55,11 @@ def main(POST_ID=None) -> None:
redditid = id(reddit_object) redditid = id(reddit_object)
post_text = ' '.join(reddit_object['thread_post']) post_text = ' '.join(reddit_object['thread_post'])
if not os.path.exists(f"./assets/temp/{reddit_object['thread_id']}/"):
settings.config["settings"]["debug"]["reuse_images"] = False
settings.config["settings"]["debug"]["reuse_mp3"] = False
settings.config["settings"]["debug"]["reuse_video"] = False
length, number_of_comments = save_text_to_mp3(reddit_object) length, number_of_comments = save_text_to_mp3(reddit_object)
length = math.ceil(length) length = math.ceil(length)
reel = length <= 60 reel = length <= 60
@ -68,20 +75,22 @@ def main(POST_ID=None) -> None:
video_path = make_final_video(number_of_comments, length, reddit_object, bg_config, reel) video_path = make_final_video(number_of_comments, length, reddit_object, bg_config, reel)
video_path = compress_video(video_path) video_path = compress_video(video_path)
# video_data, thumbnail_text = get_video_data(post_text) video_data, thumbnail_text = get_video_data(post_text)
# print("Video title:", video_data['title']) print("Video title:", video_data['title'])
# print("Video description:", video_data['description']) print("Video description:", video_data['description'])
# print("Video tags:", video_data['tags']) print("Video tags:", video_data['tags'])
# thumbnail = generate_image(thumbnail_text, f"./assets/temp/{reddit_object['thread_id']}/thumbnail_image.png") thumbnail = generate_image(thumbnail_text, f"./assets/temp/{reddit_object['thread_id']}/thumbnail_image.png")
# thumbnail = "thumbnail.png" thumbnail = add_text(
# thumbnail = add_text( thumbnail_path=thumbnail,
# thumbnail_path=thumbnail, text=video_data["thumbnail_text"],
# text=video_data["thumbnail_text"], save_path=f"./assets/temp/{reddit_object['thread_id']}/thumbnail.png"
# save_path=f"./assets/temp/{reddit_object['thread_id']}/thumbnail.png" )
# ) print("Thumbnail generated successfully at:", thumbnail)
# print("Thumbnail generated successfully at:", thumbnail) upload_video_to_youtube(video_path, video_data, thumbnail)
# upload_video_to_youtube(video_path, video_data, thumbnail)
if settings.config["settings"]["debug"]["debug"]:
shutil.rmtree(f"./assets/temp/{reddit_object['thread_id']}/")
def run_many(times) -> None: def run_many(times) -> None:
@ -137,7 +146,7 @@ if __name__ == "__main__":
from video_data_generation.gemini import get_video_data from video_data_generation.gemini import get_video_data
from video_data_generation.image_generation import generate_image, add_text from video_data_generation.image_generation import generate_image, add_text
# from utils.youtube_uploader import upload_video_to_youtube from utils.youtube_uploader import upload_video_to_youtube
if ( if (
not settings.config["settings"]["tts"]["tiktok_sessionid"] not settings.config["settings"]["tts"]["tiktok_sessionid"]

Binary file not shown.
Loading…
Cancel
Save