-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add video content generation script using Heygen API
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |