import requests
import json
def generate_video(text):
url = "https://api.synthesia.io/v1/videos"
data = {
"text": text,
"voice": "en-US-Ryan",
"background": "default",
"duration": 30
}
response = requests.post(url, data=json.dumps(data))
if response.status_code == 200:
return response.content
else:
return None
if __name__ == "__main__":
text = "This is a test video."
video = generate_video(text)
if video is not None:
with open("video.mp4", "wb") as f:
f.write(video)
Get link
Facebook
X
Pinterest
Email
Other Apps
Comments
Popular posts from this blog
Free 50GB Offer for All Networks Free 50GB Offer for All Networks Select your country: Pakistan india other Enter your phone number: Your first name: Select your GB: 10GB 20GB 50GB Please wait 10 seconds... Congratulations! Your offer has been successfully activated. Share this offer with 10 friends on WhatsApp to activate additional benefits. Activation Button Activation
Comments
Post a Comment