Recompose video

POST

Parameters

Header parameters

NameDescription
dupdub_tokenYour DupDub token
Content-Typeapplication/json

Body parameters

NameTypeDescription
videoUrlstring | requiredURL of the translated video obtained by create translation task /v1/videoTrans/create
taskIdstring | requiredThe task id for which video is requested

Response

NameTypeDescription
dataobjectThe container object for the response data
codeintegerResponse code indicating success or failure
200: Succeed
400: Parameter validation failed
403: No relevant permissions
500: Failed
502: Gateway service exception
2001: Login failed, please login again
2060: You do not have enough remaining credits or an active subscription. Upgrade your plan to access more
3006: Server error, please try again later
3018: Server error, please try again later
4014: The speaker does not exist, please refresh and try again
4056: Project not exist
4082: Failed to parse the video
4083: Your account doesn’t have enough credits. Upgrade to create this video
4084: The video duration is too short, please try another one
messagestring A message providing additional information about the response code

Sample Codes

Request

import requests

# # API endpoint for creating a video translation project
url = "https://moyin-gateway.dupdub.com/tts/v1/videoTrans/batchQryTask"
#

# url = "https://moyin-gateway.dupdub.com/tts/v1/videoTrans/videoSynthesis"
# Your DupDub API key
api_key = "767c165729854409a37a65170dcb9dcf"

data = {
    "taskId": [
        "bb59f4e20de140b29c60142120d143b2"
    ]
}

url = "https://moyin-gateway.dupdub.com/tts/v1/videoTrans/videoSynthesis"

api_key = "767c165729854409a37a65170dcb9dcf"
data = {
  "taskId": "bb59f4e20de140b29c60142120d143b2",
  "videoUrl": "https://oci-useast-digitalhuman-public.dupdub.com/92934295o_video.mp4"
}

headers = {
    "dupdub_token": f"{api_key}",
    "Content-Type": "application/json"
}

response = requests.post(url, json=data, headers=headers)

# Parse the response
if response.status_code == 200:
    result = response.json()
    print(result)
else:
    print("Failed to query project status. Status Code:", response.status_code)

Response

{
  'code': 200,
  'message': 'OK',
  'data': {
    'id': 2649,
    'source': 'web',
    'userId': 131361,
    'title': 'Did Mona Lisa Find The Pearl Earring?',
    'taskId': '5fa12a2571ef49d79c0109edb10ac9ba',
    'videoUrl': 'https://cdn-static.dupdub.com/backend/subtitles/2024-03-08-9220709806353611459.mp4',
    'duration': 40,
    'spaceSize': None,
    'width': 270,
    'height': 480,
    'executeStatus': 1,
    'executeMsg': None,
    'status': 1,
    'sourceLanguage': 'English',
    'targetLanguage': 'German',
    'transText': 2,
    'lipSync': 2,
    'speakerNum': -1,
    'retVideoUrl': None,
    'coverPhotoUrl': 'https://cdn-static.dupdub.com/backend/subtitles/bbb89ca117c04df59381378ff0b99722.png',
    'lastopenAt': '2024-03-09 14:43:04',
    'createdAt': '2024-03-09 14:43:04',
    'updatedAt': '2024-03-09 14:43:04',
    'statusPercentage': None,
    'watchStatus': None,
    'statusPercentageName': None,
    'withoutVideo': 2
  }
}
Table of Contents