Download Aliyun Video Content
Download the result file for an Aliyun video task. The task must have completed successfully; otherwise the endpoint returns an error.
Try It
GET
/aliyun/v1/videos/{task_id}/contenthttps://api-platform.ope.aiAuthentication
Use Bearer token authentication.
- Header:
Authorization: Bearer <api-key> - Example:
Authorization: Bearer sk-xxxxxx
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | Aliyun video task ID |
Request Examples
- cURL
- Python
curl -L "https://api-platform.ope.ai/aliyun/v1/videos/{task_id}/content" \
-H "Authorization: Bearer $OPEAI_API_KEY" \
-o output.mp4
import os
import requests
with requests.get(
"https://api-platform.ope.ai/aliyun/v1/videos/0385dc79-5ff8-4d82-bcb6-xxxxxx/content",
headers={"Authorization": f"Bearer {os.environ['OPEAI_API_KEY']}"},
stream=True,
timeout=300,
) as r:
r.raise_for_status()
with open("output.mp4", "wb") as f:
for chunk in r.iter_content(chunk_size=1024 * 1024):
if chunk:
f.write(chunk)
Response Example
- 200
- 400
HTTP/1.1 200 OK
Content-Type: video/mp4
[Binary video data]
{
"error": {
"message": "aliyun video task is not ready",
"type": "invalid_request_error",
"param": null,
"code": "invalid_request_error"
}
}