curl --request GET \
--url https://api.example.com/api/download/{download_id}/file{
"detail": "<string>"
}Downloads the completed video or audio file
curl --request GET \
--url https://api.example.com/api/download/{download_id}/file{
"detail": "<string>"
}Content-Disposition: Includes the original filenameContent-Type: Determined by file extension (e.g., video/mp4, audio/m4a)curl -O -J https://your-api.com/api/download/550e8400-e29b-41d4-a716-446655440000/file
wget --content-disposition https://your-api.com/api/download/550e8400-e29b-41d4-a716-446655440000/file
fetch('https://your-api.com/api/download/550e8400-e29b-41d4-a716-446655440000/file')
.then(response => {
const filename = response.headers.get('content-disposition')
.split('filename=')[1]
.replace(/"/g, '');
return response.blob().then(blob => ({ blob, filename }));
})
.then(({ blob, filename }) => {
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
a.click();
});
download_id doesn’t exist"completed"){
"detail": "Descarga no disponible o no completada"
}
{
"detail": "Archivo físico no encontrado"
}
"completed"# Step 1: Start download
DOWNLOAD_ID=$(curl -X POST https://your-api.com/api/download \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "quality": "720p"}' \
| jq -r '.download_id')
echo "Download ID: $DOWNLOAD_ID"
# Step 2: Wait for completion
while true; do
STATUS=$(curl -s https://your-api.com/api/downloads | jq -r ".[] | select(.id==\"$DOWNLOAD_ID\") | .status")
echo "Status: $STATUS"
if [ "$STATUS" = "completed" ]; then
break
fi
sleep 2
done
# Step 3: Download the file
curl -O -J https://your-api.com/api/download/$DOWNLOAD_ID/file
FileResponseContent-Disposition header matches the original video title