Skip to content

Commit

Permalink
Add video content generation script using Heygen API
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu authored and Ubuntu committed May 21, 2024
1 parent d6d9276 commit 72346af
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions services/content_creation/video_generation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import requests

HEYGEN_API_KEY = 'YOUR_HEYGEN_API_KEY'

def create_video(script):
url = 'https://api.heygen.com/v1/video'
headers = {'Authorization': f'Bearer {HEYGEN_API_KEY}'}
data = {
'script': script,
'voice': 'en_us_male1',
'avatar': 'default_avatar'
}
response = requests.post(url, headers=headers, json=data)
return response.json()

if __name__ == "__main__":
script = "Welcome to our marketing agency. We use AI to improve your marketing strategies."
print(create_video(script))

0 comments on commit 72346af

Please sign in to comment.