Haere ki ihirangi matua

Waihanga Ataata Mata-maha

I roto i tenei tauira ka titiro tatou me pehea te hanga ataata roa/maha-scene ma te whakamahi i te Predis.ai API. Te tawhā video_duration ka whakahaere mena he ataata te ataata i hangaia me te ahua kotahi, nga ahuatanga maha ranei. Ka whakatauhia e matou te uara o video_duration Tuhinga o mua long mo nga ataata maha-scene i roto i te tono.

import requests, json

url = "https://brain.predis.ai/predis_api/v1/create_content/"

payload = {
"brand_id": "YOUR_BRAND_ID",
"text": "3 tips for a healthy morning breakfast",
"media_type": "video",
"model_version": "2", # Video not supported by model_version 4
"video_duration": "long", # long signifies multi-scene videos
"template_ids": json.dumps(["TEMPLATE_ID_1"]) # pass template_ids if you want video in specific design
}

headers = {"Authorization": "YOUR_API_KEY"}

response = requests.request("POST", url, data=payload, headers=headers)

if response.status_code == 200:
json_response = response.json()
post_id = json_response.get("post_id")
post_status = json_response.get("status")

else:
print("Error occurred - {}".format(response.text))

Mena ka whiwhi koe i te inProgress mana ki te whakautu, kua angitu to tono, kei te hanga te ataata. Ina oti pai te whakaputanga o te ataata (ka rahua ranei), ka whiwhi koe i tetahi tono i runga i to URLhook kua whirihorahia me etahi atu korero mo te ataata.