From 2012301244ff87b2cf389bdd0fca7040512a328e Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 14 Nov 2024 14:08:15 -0500 Subject: [PATCH] dunno --- tork.py | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/tork.py b/tork.py index 79da807..3f4da52 100644 --- a/tork.py +++ b/tork.py @@ -1,12 +1,36 @@ from os import environ +from elevenlabs import ElevenLabs +from moviepy.editor import CompositeVideoClip, TextClip, VideoFileClip from praw import Reddit reddit = Reddit( - client_id=environ["ID"], - client_secret=environ["SECRET"], - user_agent="tork:1.0.0:u/czenty", + client_id=environ["REDDIT_ID"], + client_secret=environ["REDDIT_SECRET"], + user_agent="tork:0.1.0:u/czenty", ) -for submission in reddit.subreddit("AskReddit").hot(limit=10): - print(submission.title) +submission = reddit.submission("1gpmw0i") +submission.comment_sort = "confidence" +submission.comments.replace_more(limit=0) + +print(submission.title) + +for comment in submission.comments[:10]: + print(comment.body) + +client = ElevenLabs(api_key=environ["ELEVEN_KEY"]) + +audio = client.generate( + text="Hello! 你好! Hola! नमस्ते! Bonjour! こんにちは! مرحبا! 안녕하세요! Ciao! Cześć! Привіт! வணக்கம்!", + voice="Will", + model="eleven_multilingual_v2", +) + +clip = VideoFileClip("input.webm").subclip(30, 90) + +text = TextClip("Hey There", fontsize=70, color="white") +text = text.set_position("center").set_duration(10) + +video = CompositeVideoClip([clip, text]) +video.write_videofile("out.mp4")