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
Bright Data 媒体数据 API 的输入字段参考。从 YouTube、Vimeo、TikTok 和 Bilibili 下载视频、音频、字幕、缩略图和故事板。
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"
}输入字段
请求主体是一个 JSON 数组。数组中的每个对象都是一个单独的下载任务。| 值 | 描述 |
|---|---|
full | 下载包含默认音轨的视频 |
video_only | 下载不含音频的视频流 |
audio_only | 仅下载默认音轨 |
all_audio_tracks | 下载所有可用的音轨(例如多种语言),不包含视频 |
all_audio_tracks+video | 下载视频以及所有可用的音轨 |
none | 跳过媒体下载。当您仅需要字幕、缩略图或故事板时使用 |
captions 为 true 时适用。| 值 | 描述 |
|---|---|
vtt | WebVTT 格式 |
srt | SubRip 格式 |
json3 | JSON 格式 |
360、480、720、1080、1440、2160360、480、720、1080、1440、2160orientation 时,接受全部三种方向。| 值 | 描述 |
|---|---|
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.
查询参数
Your Media Extraction collector ID. This is a fixed value assigned when the feature is enabled on your account.
"YOUR_COLLECTOR_ID"
请求体
A JSON array of extraction job objects. Each object represents one media extraction job. Multiple jobs can be submitted in a single request.
1The full URL of the video to download. Supported platforms: YouTube, Vimeo, TikTok, Bilibili.
"https://www.video-page-example.com/v=89438398439"
Specifies what content type to download.
full, video_only, audio_only, all_audio_tracks, all_audio_tracks+video, none Whether to download available captions or subtitles for the video.
The file format for downloaded captions. Only applies when captions is true. Supported formats: vtt, srt, json3.
vtt, srt, json3 Minimum accepted video resolution, expressed as a vertical pixel count. The download proceeds only if a resolution at or above this height is available. Common values: 360, 480, 720, 1080, 1440, 2160.
720
Maximum accepted video resolution, expressed as a vertical pixel count. The download proceeds only if a resolution at or below this height is available. Common values: 360, 480, 720, 1080, 1440, 2160.
1440
Restricts the download to videos with the listed orientations. When omitted, all three orientations are accepted.
vertical, horizontal, square ["vertical", "square"]
Selects which of the available renditions to download when more than one satisfies min_height and max_height.
highest, lowest Whether to include the video's thumbnail image in the results.
Whether to include the video's storyboard images (sprite sheets used for timeline preview scrubbing) in the results.
此页面对您有帮助吗?