Download a language MP4
Wait until the dub’s completion is full_ready, then start a download job.
DL=$(curl -sS -X POST "$BRAIV_API_BASE/videos/$VIDEO_ID/downloads" \ -H "Authorization: Bearer $BRAIV_API_KEY" -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"artifact":"language_video","language":"es"}')JOB=$(echo "$DL" | jq -r .jobId)
for i in $(seq 1 60); do STATUS=$(curl -sS "$BRAIV_API_BASE/jobs/$JOB" -H "Authorization: Bearer $BRAIV_API_KEY" | jq -r .status) if [ "$STATUS" = "ready" ] || [ "$STATUS" = "failed" ]; then break; fi sleep 10done
curl -sS "$BRAIV_API_BASE/downloads/$(echo "$DL" | jq -r .downloadRequestId)" \ -H "Authorization: Bearer $BRAIV_API_KEY"Sample-tier accounts receive a truncated file (truncated: true). Wait for full_ready before requesting a full language video.