Trigger a media extraction job
curl --request POST \
--url https://api.brightdata.com/dca/trigger_hp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"url": "https://www.video-page-example.com/v=89438398439",
"format": "all_audio_tracks+video",
"captions": true,
"captions_format": "vtt",
"min_height": 720,
"max_height": 1440,
"orientation": [
"vertical",
"horizontal",
"square"
],
"quality_priority": "highest",
"thumbnail": true,
"storyboards": true
}
]
'import requests
url = "https://api.brightdata.com/dca/trigger_hp"
payload = [
{
"url": "https://www.video-page-example.com/v=89438398439",
"format": "all_audio_tracks+video",
"captions": True,
"captions_format": "vtt",
"min_height": 720,
"max_height": 1440,
"orientation": ["vertical", "horizontal", "square"],
"quality_priority": "highest",
"thumbnail": True,
"storyboards": True
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
url: 'https://www.video-page-example.com/v=89438398439',
format: 'all_audio_tracks+video',
captions: true,
captions_format: 'vtt',
min_height: 720,
max_height: 1440,
orientation: ['vertical', 'horizontal', 'square'],
quality_priority: 'highest',
thumbnail: true,
storyboards: true
}
])
};
fetch('https://api.brightdata.com/dca/trigger_hp', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/dca/trigger_hp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'url' => 'https://www.video-page-example.com/v=89438398439',
'format' => 'all_audio_tracks+video',
'captions' => true,
'captions_format' => 'vtt',
'min_height' => 720,
'max_height' => 1440,
'orientation' => [
'vertical',
'horizontal',
'square'
],
'quality_priority' => 'highest',
'thumbnail' => true,
'storyboards' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.brightdata.com/dca/trigger_hp"
payload := strings.NewReader("[\n {\n \"url\": \"https://www.video-page-example.com/v=89438398439\",\n \"format\": \"all_audio_tracks+video\",\n \"captions\": true,\n \"captions_format\": \"vtt\",\n \"min_height\": 720,\n \"max_height\": 1440,\n \"orientation\": [\n \"vertical\",\n \"horizontal\",\n \"square\"\n ],\n \"quality_priority\": \"highest\",\n \"thumbnail\": true,\n \"storyboards\": true\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.brightdata.com/dca/trigger_hp")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"url\": \"https://www.video-page-example.com/v=89438398439\",\n \"format\": \"all_audio_tracks+video\",\n \"captions\": true,\n \"captions_format\": \"vtt\",\n \"min_height\": 720,\n \"max_height\": 1440,\n \"orientation\": [\n \"vertical\",\n \"horizontal\",\n \"square\"\n ],\n \"quality_priority\": \"highest\",\n \"thumbnail\": true,\n \"storyboards\": true\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/dca/trigger_hp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"url\": \"https://www.video-page-example.com/v=89438398439\",\n \"format\": \"all_audio_tracks+video\",\n \"captions\": true,\n \"captions_format\": \"vtt\",\n \"min_height\": 720,\n \"max_height\": 1440,\n \"orientation\": [\n \"vertical\",\n \"horizontal\",\n \"square\"\n ],\n \"quality_priority\": \"highest\",\n \"thumbnail\": true,\n \"storyboards\": true\n }\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"inputs": 1,
"job_id": "hp_mn1l61rn1p94ynijur"
}媒体数据 API
媒体数据 API
Bright Data 媒体数据 API 的输入字段参考。从 YouTube、Vimeo、TikTok 和 Bilibili 下载视频、音频、字幕、缩略图和故事板。
POST
/
dca
/
trigger_hp
Trigger a media extraction job
curl --request POST \
--url https://api.brightdata.com/dca/trigger_hp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"url": "https://www.video-page-example.com/v=89438398439",
"format": "all_audio_tracks+video",
"captions": true,
"captions_format": "vtt",
"min_height": 720,
"max_height": 1440,
"orientation": [
"vertical",
"horizontal",
"square"
],
"quality_priority": "highest",
"thumbnail": true,
"storyboards": true
}
]
'import requests
url = "https://api.brightdata.com/dca/trigger_hp"
payload = [
{
"url": "https://www.video-page-example.com/v=89438398439",
"format": "all_audio_tracks+video",
"captions": True,
"captions_format": "vtt",
"min_height": 720,
"max_height": 1440,
"orientation": ["vertical", "horizontal", "square"],
"quality_priority": "highest",
"thumbnail": True,
"storyboards": True
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
url: 'https://www.video-page-example.com/v=89438398439',
format: 'all_audio_tracks+video',
captions: true,
captions_format: 'vtt',
min_height: 720,
max_height: 1440,
orientation: ['vertical', 'horizontal', 'square'],
quality_priority: 'highest',
thumbnail: true,
storyboards: true
}
])
};
fetch('https://api.brightdata.com/dca/trigger_hp', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/dca/trigger_hp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'url' => 'https://www.video-page-example.com/v=89438398439',
'format' => 'all_audio_tracks+video',
'captions' => true,
'captions_format' => 'vtt',
'min_height' => 720,
'max_height' => 1440,
'orientation' => [
'vertical',
'horizontal',
'square'
],
'quality_priority' => 'highest',
'thumbnail' => true,
'storyboards' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.brightdata.com/dca/trigger_hp"
payload := strings.NewReader("[\n {\n \"url\": \"https://www.video-page-example.com/v=89438398439\",\n \"format\": \"all_audio_tracks+video\",\n \"captions\": true,\n \"captions_format\": \"vtt\",\n \"min_height\": 720,\n \"max_height\": 1440,\n \"orientation\": [\n \"vertical\",\n \"horizontal\",\n \"square\"\n ],\n \"quality_priority\": \"highest\",\n \"thumbnail\": true,\n \"storyboards\": true\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.brightdata.com/dca/trigger_hp")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"url\": \"https://www.video-page-example.com/v=89438398439\",\n \"format\": \"all_audio_tracks+video\",\n \"captions\": true,\n \"captions_format\": \"vtt\",\n \"min_height\": 720,\n \"max_height\": 1440,\n \"orientation\": [\n \"vertical\",\n \"horizontal\",\n \"square\"\n ],\n \"quality_priority\": \"highest\",\n \"thumbnail\": true,\n \"storyboards\": true\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/dca/trigger_hp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"url\": \"https://www.video-page-example.com/v=89438398439\",\n \"format\": \"all_audio_tracks+video\",\n \"captions\": true,\n \"captions_format\": \"vtt\",\n \"min_height\": 720,\n \"max_height\": 1440,\n \"orientation\": [\n \"vertical\",\n \"horizontal\",\n \"square\"\n ],\n \"quality_priority\": \"highest\",\n \"thumbnail\": true,\n \"storyboards\": true\n }\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"inputs": 1,
"job_id": "hp_mn1l61rn1p94ynijur"
}媒体数据 API 默认未启用。请联系 support@brightdata.com 以在您的账户中启用该功能。
每个请求都需要一个交付目标。在发送第一个请求之前,请配置交付目标。请参阅 交付选项。
输入字段
请求主体是一个 JSON 数组。数组中的每个对象都是一个单独的下载任务。指定要下载的内容类型。
| 值 | 描述 |
|---|---|
full | 下载包含默认音轨的视频 |
video_only | 下载不含音频的视频流 |
audio_only | 仅下载默认音轨 |
all_audio_tracks | 下载所有可用的音轨(例如多种语言),不包含视频 |
all_audio_tracks+video | 下载视频以及所有可用的音轨 |
none | 跳过媒体下载。当您仅需要字幕、缩略图或故事板时使用 |
将下载限制为具有所列方向的视频。可接受一个或多个值。省略
示例:
orientation 时,接受全部三种方向。| 值 | 描述 |
|---|---|
vertical | 竖向视频,高度大于宽度 |
horizontal | 横向视频,宽度大于高度 |
square | 宽度与高度相等的视频 |
["vertical", "square"]在所选高度范围(
min_height 和 max_height)内,优先选择文件大小最大或最小的版本进行下载。| 值 | 描述 |
|---|---|
highest | 下载可用文件大小最大的格式 |
lowest | 下载可用文件大小最小的格式 |
用于文件上传的自定义路径。覆盖交付设置中配置的路径。支持模板变量:
{{datetime}}、{{video_id}}、{{job}}。示例: "my-videos/{{video_id}}/{{datetime}}"已上传文件的自定义文件名。该值作为所有输出文件的基础名称使用(例如
<filename>.mp4、<filename>.metadata.json、<filename>.sub.0)。支持模板变量:{{datetime}}、{{video_id}}、{{job}}。示例: "{{video_id}}_{{datetime}}"授权
Your Bright Data API key. Find it in the Bright Data Control Panel.
查询参数
请求体
application/json
A JSON array of extraction job objects. Each object represents one media extraction job. Multiple jobs can be submitted in a single request.
Minimum array length:
1此页面对您有帮助吗?