import requests, json, time voice1 = "Joanna" # voice2 = "Matthew" # In Python you can use triple quotes if you have to put quotes inside a string # example_triple_quotes = """ "One guy rang me and said, 'She is coming to see you. That's what I'm paying # you for,'" He says. """ text1 = "A super easy tool to automatically create videos with auto-generated voice-overs and the exact subtitles. Example of a video sequence with " + voice1 +"'s voice." # text2 = "Second sequence with " + voice2 +"." picture1 = 'https://i.postimg.cc/3r4RL5YX/ocean1.jpg' # picture2 = 'https://i.postimg.cc/Znh1FdJD/ocean2.jpg' data = { 'text_segments': [ { 'api_source_type': 'picture', 'picture': picture1, 'textforvideo': text1, 'voice_id': voice1 } # , # { # 'api_source_type': 'picture', # 'picture': picture2, # 'textforvideo': text2, # 'voice_id': voice2 # } ] } APIKEY = 'YOUR SECRET KEY HERE' headers = {'x-api-key': f"{APIKEY}"} response = requests.post('https://rollideo.com/create/video', headers=headers, json=data) data2 = response.json() launched = data2.get("launched", "ko") if launched == "ok": # Use the Polling API endpoint to find out the status of the above request /create/video. for i in range(1000): time.sleep(10) print(i) response2 = requests.post('https://rollideo.com/task/video', headers=headers, json=data2) success = response2.json().get("success", "not yet") if success == "ok" or success == "ko": print(response2.json()) break else: print("The launch of the task has failed") print(data2.get("message"))