├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 SamurAIGPT 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Text To Video API 2 | 3 | ### Youtube tutorial -> https://youtu.be/LDBnlO3PDBY 4 | 5 | ### Medium article -> https://medium.com/@anilmatcha/text-to-video-api-in-python-ai-video-automation-tutorial-561b49241d70 6 | 7 | ### Steps 8 | 9 | To generate a video from text, here are the steps involved 10 | 11 | 1. Generate an API key from https://viral.vadoo.tv/profile 12 | 2. Setup a webhook url at https://viral.vadoo.tv/profile to received generated video metadata 13 | 14 | ### Python code 15 | 16 | Install requests library to send a post request 17 | 18 | ```pip install requests``` 19 | 20 | Use the below code to generate a video, the download url of generated video will be sent to the webhook setup 21 | Topic, voice, theme, language and duration are optional but can be customized. More info about these are available here https://docs.vadoo.tv/docs/category/guide 22 | 23 | ``` 24 | import requests 25 | 26 | # Replace 'YOUR_API_KEY' with your actual API key 27 | API_KEY = 'YOUR_API_KEY' 28 | url = 'https://viralapi.vadoo.tv/api/generate_video' 29 | 30 | # Define the request headers 31 | headers = { 32 | 'X-API-KEY': API_KEY, 33 | 'Content-Type': 'application/json' 34 | } 35 | 36 | # Define the request body parameters 37 | data = { 38 | 'topic': 'Random AI Story', # Optional: specify your topic or leave it as the default 39 | 'voice': 'Charlie', # Optional: specify the voice or leave it as the default 40 | 'theme': 'Hormozi_1', # Optional: specify the theme or leave it as the default 41 | 'language': 'English', # Optional: specify the language or leave it as the default 42 | 'duration': '30-60' # Optional: specify the duration or leave it as the default 43 | } 44 | 45 | # Make the POST request to generate the video 46 | response = requests.post(url, headers=headers, json=data) 47 | 48 | # Check if the request was successful 49 | if response.status_code == 200: 50 | response_data = response.json() 51 | print(f"Video ID: {response_data['vid']}") 52 | else: 53 | print(f"Failed to generate video. Status code: {response.status_code}") 54 | print(response.text) 55 | ``` 56 | 57 | Link to app [Text to Video API](https://www.vadoo.tv/text-to-video-api) 58 | --------------------------------------------------------------------------------