Skip to content ka sehloohong

Theha Lifitio tsa Lits'oants'o Tse Ngata

Mohlaleng ona re tla sheba mokhoa oa ho etsa livideo tse telele / tse ngata ka ho sebelisa Predis.ai API. Paramethara video_duration e laola hore na video e hlahisitsoeng e tla ba video e nang le ketsahalo e le 'ngoe kapa liketsahalo tse ngata. Re tla beha boleng ba video_duration ho long bakeng sa livideo tsa liketsahalo tse ngata ka kopo.

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))

Haeba u fumana file ea inProgress boemo ha u arabela, kopo ea hau e atlehile 'me video e ntse e hlahisoa. Hang ha video e hlahisoa ka katleho (kapa e hloleha), u tla fumana kopo ho URL ea hau ea webhook e nang le lintlha tse ling mabapi le video.