# 下载器

该 `youtube_download` 源提供您选择的 YouTube 视频的音频/视频内容。请注意，由于数据量可能很大，此源仅通过异步 [**Push-Pull 集成**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/web-scraper-api/integration-methods/push-pull) 和 [**Cloud Storage**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/web-scraper-api/features/result-processing-and-storage/cloud-storage) 功能可用。

## YouTube 下载器的工作原理

1. 通过 API 提交：
   * 一个或多个 YouTube 视频 ID；
   * 云存储详细信息。
2. 获取 API 响应，确认您下载视频的请求已成功被接受。
3. 一旦我们系统处理完视频，即可在指定的云存储位置获取这些视频。

{% hint style="success" %}
**注意**:

* 下载器默认使用 720p 视频分辨率。如果 720p 不可用，下载器将选择低于 720p 的最佳可用质量。您可以使用 `context: video_quality`参数来覆盖此行为。
* 您可以下载长度最多为 12 小时的视频。
* 下载时间限制为 1 小时。
  {% endhint %}

## 输入参数值

| 参数                                                          | 说明                                                                                                                                    | 默认值                |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `source`                                                    | 设置爬虫来源。                                                                                                                               | `youtube_download` |
| `query`                                                     | YouTube 视频 ID。                                                                                                                        | -                  |
| `storage_type`                                              | 云服务的存储类型（`gcs`, `s3` 或 `s3_compatible`)                                                                                               | -                  |
| `storage_url`                                               | 您希望将结果上传到的云存储位置的存储桶名称（针对 AWS S3）或 URL（针对其他 S3 兼容存储）。                                                                                  | -                  |
| `callback_url`                                              | 您的回调端点 URL。 [**更多信息**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/integration-methods/push-pull#callback) | -                  |
| <p><code>context:</code><br><code>download\_type</code></p> | 指定要下载 `audio`, `video`，或两者 - `audio_video`.                                                                                           | `audio_video`      |
| <p><code>context:</code><br><code>video\_quality</code></p> | 设置视频质量： `best`, `worst`，或一个分辨率 -  `480`, `720`, `1080`, `1440`, `2160(4K)`.                                                           | `720`              |

## 提交单个作业

#### 端点

```
POST https://data.oxylabs.io/v1/queries
```

#### 输入

在 JSON 有效载荷中提供作业参数，如下例所示：

{% tabs %}
{% tab title="cURL" %}

```sh
curl --user "user:pass1" \
'https://data.oxylabs.io/v1/queries' \
-H "Content-Type: application/json" \
-d '{
    "source": "youtube_download",
    "query": "9cQBNYsCqQs",
    "storage_type": "s3",
    "storage_url": "s3://your-s3-bucket/your-folder/"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from pprint import pprint

payload = {
    "source": "youtube_download",
    "query": "9cQBNYsCqQs",
    "context": [
        {
            "key": "download_type",
            "value": "video"
        },
        {
            "key": "video_quality",
            "value": "1080"
        }
    ],
    "storage_type": "s3",
    "storage_url": "s3://your-s3-bucket/your-folder/"
}

response = requests.request(
    'POST',
    'https://data.oxylabs.io/v1/queries',
    auth=('user', 'pass1'),
    json=payload,
)

pprint(response.json())
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$params = array(
    'source' => 'youtube_download',
    'query' => '9cQBNYsCqQs',
    "context" => [
        [
            "key" => "download_type",
            "value" => "video",
        ],
        [
            "key" => "video_quality",
            "value" => "1080",
        ]
    ],
    'storage_type' => 's3',
    'storage_url' => 's3://your-s3-bucket/your-folder/'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://data.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "YOUR_USERNAME" . ":" . "YOUR_PASSWORD");

$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;

namespace OxyApi
{
    class Program
    {
        static async Task Main()
        {
            const string Username = "YOUR_USERNAME";
            const string Password = "YOUR_PASSWORD";
            var payload = new Dictionary<string, object>()
            {
                { "source", "youtube_download" },
                { "query", "9cQBNYsCqQs" },
                { "context", new[] {
                    new { key = "download_type", value = "video" },
                    new { key = "video_quality", value = "1080" }
                }},
                { "storage_type", "s3" },
                { "storage_url", "your-s3-bucket/your-folder/" }
            };
            
            var client = new HttpClient();
            var requestMessage = new HttpRequestMessage(HttpMethod.Post, "https://data.oxylabs.io/v1/queries/batch");
            requestMessage.Content = JsonContent.Create(payload);
            
            var authenticationString = $"{Username}:{Password}";
            var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString));
            requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString);
            
            var response = await client.SendAsync(requestMessage);
            var contents = await response.Content.ReadAsStringAsync();
            Console.WriteLine(contents);
        }
    }
}
```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	const Username = "YOUR_USERNAME"
	const Password = "YOUR_PASSWORD"

	// Define the context structure
	type ContextItem struct {
		Key   string `json:"key"`
		Value string `json:"value"`
	}

	// Create payload with the same structure as the C# example
	payload := map[string]interface{}{
		"source": "youtube_download",
		"query":  []string{"9cQBNYsCqQs", "KGOsWPF4Wfs"},
		"context": []ContextItem{
			{Key: "download_type", Value: "video"},
			{Key: "video_quality", Value: "1080"},
		},
		"storage_type": "s3",
		"storage_url":  "your-s3-bucket/your-folder/",
	}

	jsonValue, _ := json.Marshal(payload)
	client := &http.Client{}
	request, _ := http.NewRequest("POST",
		"https://data.oxylabs.io/v1/queries/batch",
		bytes.NewBuffer(jsonValue),
	)
	request.Header.Add("Content-type", "application/json")
	request.SetBasicAuth(Username, Password)
	response, _ := client.Do(request)
	responseText, _ := ioutil.ReadAll(response.Body)
	fmt.Println(string(responseText))
}
```

{% endtab %}

{% tab title="Java" %}

```java
package org.example;
import okhttp3.*;
import org.json.JSONArray;
import org.json.JSONObject;
public class Main implements Runnable {
    private static final String AUTHORIZATION_HEADER = "Authorization";
    public static final String USERNAME = "YOUR_USERNAME";
    public static final String PASSWORD = "YOUR_PASSWORD";
    public void run() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("source", "youtube_download");
        jsonObject.put("query", "9cQBNYsCqQs");
        
        // Add context structure
        JSONArray contextArray = new JSONArray();
        
        JSONObject downloadTypeContext = new JSONObject();
        downloadTypeContext.put("key", "download_type");
        downloadTypeContext.put("value", "video");
        contextArray.put(downloadTypeContext);
        
        JSONObject videoQualityContext = new JSONObject();
        videoQualityContext.put("key", "video_quality");
        videoQualityContext.put("value", "1080");
        contextArray.put(videoQualityContext);
        
        jsonObject.put("context", contextArray);
        
        jsonObject.put("storage_type", "s3");
        jsonObject.put("storage_url", "your-s3-bucket/your-folder/");
        
        Authenticator authenticator = (route, response) -> {
            String credential = Credentials.basic(USERNAME, PASSWORD);
            return response
                    .request()
                    .newBuilder()
                    .header(AUTHORIZATION_HEADER, credential)
                    .build();
        };
        var client = new OkHttpClient.Builder()
                .authenticator(authenticator)
                .build();
        var mediaType = MediaType.parse("application/json; charset=utf-8");
        var body = RequestBody.create(jsonObject.toString(), mediaType);
        var request = new Request.Builder()
                .url("https://data.oxylabs.io/v1/queries/batch")
                .post(body)
                .build();
        try (var response = client.newCall(request).execute()) {
            assert response.body() != null;
            System.out.println(response.body().string());
        } catch (Exception exception) {
            System.out.println("Error: " + exception.getMessage());
        }
        System.exit(0);
    }
    public static void main(String[] args) {
        new Thread(new Main()).start();
    }
}
```

{% endtab %}

{% tab title="Node.js" %}

```sh
import fetch from 'node-fetch';

const username = 'YOUR_USERNAME';
const password = 'YOUR_PASSWORD';
const body = {
  source: 'youtube_download',
  query: '9cQBNYsCqQs',
  context: [
    { key: "download_type", value: "video" },
    { key: "video_quality", value: "1080"},
  ],
  storage_type: 's3',
  storage_url: 's3://your-s3-bucket/your-folder/'
};
const response = await fetch('https://data.oxylabs.io/v1/queries', {
  method: 'post',
  body: JSON.stringify(body),
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
  }
});

console.log(await response.json());
```

{% endtab %}
{% endtabs %}

## 批量作业

您可以在单次批量请求中提交最多 5,000 个视频 ID。

#### 端点

```
POST https://data.oxylabs.io/v1/queries/batch
```

{% hint style="warning" %}
**重要：** 使用 `/batch` 端点时，您只能提交 `query`参数值的列表。所有其他参数应为单一值。
{% endhint %}

#### 输入

{% tabs %}
{% tab title="cURL" %}

```sh
curl --user "user:pass1" \
'https://data.oxylabs.io/v1/queries/batch' \
-H 'Content-Type: application/json' \
-d '{
    "source": "youtube_download",
    "query": ["9cQBNYsCqQs", "KGOsWPF4Wfs"],
        "context": [
        {
            "key": "download_type",
            "value": "video"
        },
        {
            "key": "video_quality",
            "value": "1080"
        }
    ],
    "storage_type": "s3",
    "storage_url": "your-s3-bucket/your-folder/"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json
from pprint import pprint

payload = {
    "source": "youtube_download",
    "query": ["9cQBNYsCqQs", "KGOsWPF4Wfs"],
    "context": [
        {
            "key": "download_type",
            "value": "video"
        },
        {
            "key": "video_quality",
            "value": "1080"
        }
    ],
    "storage_type": "s3",
    "storage_url": "your-s3-bucket/your-folder/"
}

response = requests.request(
    'POST',
    'https://data.oxylabs.io/v1/queries/batch',
    auth=('user', 'pass1'),
    json=payload,
)

# 打印美化后的响应。
pprint(response.json())
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$payload = array(
    "source" => "youtube_download",
    "query" => array("9cQBNYsCqQs", "KGOsWPF4Wfs"),
    "context" => [
        [
            "key" => "download_type",
            "value" => "video",
        ],
        [
            "key" => "video_quality",
            "value" => "1080",
        ]
    ],
    "storage_type" => "s3",
    "storage_url" => "your-s3-bucket/your-folder/"
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://data.oxylabs.io/v1/queries/batch");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "user" . ":" . "pass1");

$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;

namespace OxyApi
{
    class Program
    {
        static async Task Main()
        {
            const string Username = "YOUR_USERNAME";
            const string Password = "YOUR_PASSWORD";
            var payload = new Dictionary<string, object>()
            {
                { "source", "youtube_download" },
                { "query", new[] { "9cQBNYsCqQs", "KGOsWPF4Wfs" } },
                { "context", new[] {
                    new { key = "download_type", value = "video" },
                    new { key = "video_quality", value = "1080" }
                }},
                { "storage_type", "s3" },
                { "storage_url", "your-s3-bucket/your-folder/" }
            };
            
            var client = new HttpClient();
            var requestMessage = new HttpRequestMessage(HttpMethod.Post, "https://data.oxylabs.io/v1/queries/batch");
            requestMessage.Content = JsonContent.Create(payload);
            
            var authenticationString = $"{Username}:{Password}";
            var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString));
            requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString);
            
            var response = await client.SendAsync(requestMessage);
            var contents = await response.Content.ReadAsStringAsync();
            Console.WriteLine(contents);
        }
    }
}
```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	const Username = "YOUR_USERNAME"
	const Password = "YOUR_PASSWORD"

	// Define the context structure
	type ContextItem struct {
		Key   string `json:"key"`
		Value string `json:"value"`
	}

	// Create payload with the same structure as the C# example
	payload := map[string]interface{}{
		"source": "youtube_download",
		"query":  "9cQBNYsCqQs",
		"context": []ContextItem{
			{Key: "download_type", Value: "video"},
			{Key: "video_quality", Value: "1080"},
		},
		"storage_type": "s3",
		"storage_url":  "your-s3-bucket/your-folder/",
	}

	jsonValue, _ := json.Marshal(payload)
	client := &http.Client{}
	request, _ := http.NewRequest("POST",
		"https://data.oxylabs.io/v1/queries/batch",
		bytes.NewBuffer(jsonValue),
	)
	request.Header.Add("Content-type", "application/json")
	request.SetBasicAuth(Username, Password)
	response, _ := client.Do(request)
	responseText, _ := ioutil.ReadAll(response.Body)
	fmt.Println(string(responseText))
}
```

{% endtab %}

{% tab title="Java" %}

```java
package org.example;
import okhttp3.*;
import org.json.JSONArray;
import org.json.JSONObject;
public class Main implements Runnable {
    private static final String AUTHORIZATION_HEADER = "Authorization";
    public static final String USERNAME = "YOUR_USERNAME";
    public static final String PASSWORD = "YOUR_PASSWORD";
    public void run() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("source", "youtube_download");
        
        // 将 query 更改为与 C# 示例相同的数组格式
        JSONArray queryArray = new JSONArray();
        queryArray.put("9cQBNYsCqQs");
        queryArray.put("KGOsWPF4Wfs");
        jsonObject.put("query", queryArray);
        
        // Add context structure
        JSONArray contextArray = new JSONArray();
        
        JSONObject downloadTypeContext = new JSONObject();
        downloadTypeContext.put("key", "download_type");
        downloadTypeContext.put("value", "video");
        contextArray.put(downloadTypeContext);
        
        JSONObject videoQualityContext = new JSONObject();
        videoQualityContext.put("key", "video_quality");
        videoQualityContext.put("value", "1080");
        contextArray.put(videoQualityContext);
        
        jsonObject.put("context", contextArray);
        
        jsonObject.put("storage_type", "s3");
        jsonObject.put("storage_url", "your-s3-bucket/your-folder/");
        
        Authenticator authenticator = (route, response) -> {
            String credential = Credentials.basic(USERNAME, PASSWORD);
            return response
                    .request()
                    .newBuilder()
                    .header(AUTHORIZATION_HEADER, credential)
                    .build();
        };
        var client = new OkHttpClient.Builder()
                .authenticator(authenticator)
                .build();
        var mediaType = MediaType.parse("application/json; charset=utf-8");
        var body = RequestBody.create(jsonObject.toString(), mediaType);
        var request = new Request.Builder()
                .url("https://data.oxylabs.io/v1/queries/batch")
                .post(body)
                .build();
        try (var response = client.newCall(request).execute()) {
            assert response.body() != null;
            System.out.println(response.body().string());
        } catch (Exception exception) {
            System.out.println("Error: " + exception.getMessage());
        }
        System.exit(0);
    }
    public static void main(String[] args) {
        new Thread(new Main()).start();
    }
}
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
import fetch from 'node-fetch';

const username = 'YOUR_USERNAME';
const password = 'YOUR_PASSWORD';

const payload = {
    source: 'youtube_download',
    query: ['9cQBNYsCqQs', 'KGOsWPF4Wfs'],
      context: [
        { key: "download_type", value: "video" },
        { key: "video_quality", value: "1080"},
      ]
    storage_type: 's3',
    storage_url: 'your-s3-bucket/your-folder/'
};

const response = await fetch('https://data.oxylabs.io/v1/queries/batch', {
    method: 'post',
    body: JSON.stringify(payload),
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
    }
});

console.log(await response.json());
```

{% endtab %}
{% endtabs %}

API 将以 JSON 对象响应，其中包含为每个创建的作业返回的作业信息。作业状态将在 **`pending`** 直到下载完成为止。

## 检查作业状态

如果您在提交作业时提供了有效的 [**callback URL**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/integration-methods/push-pull#callback) ，我们将在完成时通过向指定的回调 URL 发送一个 `JSON` 有效载荷来通知您。&#x20;

然而，如果您在未使用 [**callback service**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/integration-methods/push-pull#callback)的情况下提交了作业，您可以手动检查作业状态。从提交作业后收到的响应消息的 `rel:self` 部分的 `href` 字段中检索该 URL。用于检查作业状态的 URL 将类似于以下内容： `http://data.oxylabs.io/v1/queries/12345678900987654321`请求该 URL 将返回作业信息，包括其当前 `status`.

### 端点 <a href="#endpoint-1" id="endpoint-1"></a>

```
GET https://data.oxylabs.io/v1/queries/{id}
```

## 云存储

您可以将 YouTube 视频传送到 [**Google Cloud Storage**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/features/result-processing-and-storage/cloud-storage#google-cloud-storage), [**Amazon S3**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/features/result-processing-and-storage/cloud-storage#amazon-s3), [**Alibaba OSS**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/features/result-processing-and-storage/cloud-storage#alibaba-cloud-object-storage-service-oss), 或 [**其他 S3 兼容云存储**](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/features/result-processing-and-storage/cloud-storage#other-s3-compatible-storage).

内容文件将出现在您的云存储位置，并将根据以下命名模式之一命名：

* `{video_id}_{job_id}.mp4` – 对于视频
* `{video_id}_{job_id}.m4a` – 对于音频

### 存储参数

<table><thead><tr><th width="170.03125">参数</th><th width="263.372304199773">说明</th><th>有效值</th></tr></thead><tbody><tr><td><code>storage_type</code></td><td>您的云存储类型。</td><td><p><code>gcs</code> (Google Cloud Storage);</p><p><code>s3</code> (AWS S3);<br><code>s3_compatible</code> (其他 S3 兼容存储解决方案)。</p></td></tr><tr><td><code>storage_url</code></td><td>您的云存储 URL</td><td><p>任意 <code>s3</code> 或 <code>gcs</code> 存储桶名称；</p><p>任意 <code>s3-compatible</code> 存储 URL。</p></td></tr></tbody></table>

### **Google Cloud Storage 设置** <a href="#google-cloud-storage-setup" id="google-cloud-storage-setup"></a>

要将作业结果上传到您的 Google Cloud Storage 存储桶，请 **为我们的服务设置特殊权限** ，如我们的 [Google Cloud Storage documentation](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/features/result-processing-and-storage/cloud-storage#google-cloud-storage).

```json
{
    "source": "youtube_download",
    "query": "9cQBNYsCqQs",
    "storage_type": "gcs",
    "storage_url": "bucket_name/path"
}
```

### Amazon S3 设置

要将作业结果上传到您的 Amazon S3 存储桶，请为我们的服务设置访问权限。为此，请前往 [**https://s3.console.aws.amazon.com/**](https://s3.console.aws.amazon.com/) → **`S3`** → **`存储`** → **`Bucket Name`**` ``（如果您没有，请创建一个新的）` → **`权限`** → **`存储桶策略`**.

使用下面的存储桶策略（不要忘记在 `YOUR_BUCKET_NAME`):

```json
{
    下更改存储桶名称）
    "Version": "2012-10-17",
    "Id": "Policy1577442634787",
        {
            "Statement": [
            "Sid": "Stmt1577442633719",
            "Effect": "Allow",
                "Principal": {
            },
            "AWS": "arn:aws:iam::324311890426:user/oxylabs.s3.uploader"
            "Action": "s3:GetBucketLocation",
        },
        {
            "Statement": [
            "Sid": "Stmt1577442633719",
            "Effect": "Allow",
                "Principal": {
            },
            "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME"
                "Action": [
                "s3:PutObject",
            ],
            "s3:PutObjectAcl"
        }
    ]
}
```

"Resource": "arn:aws:s3:::YOUR\_BUCKET\_NAME/\*"

### 此策略允许我们向您的存储桶写入，向您授予对已上传文件的访问权限，并知道存储桶的位置。

Alibaba Cloud OSS 设置 `为了将结果保存到您的 Alibaba Cloud 对象存储服务 (OSS)，您必须创建` ACCESS\_KEY\_ID `和` ACCESS\_KEY\_SECRET [并使用它们来形成存储 URL。请按照我们的 ](https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/features/result-processing-and-storage/cloud-storage#alibaba-cloud-object-storage-service-oss).

```json
{
    "source": "youtube_download",
    "query": "9cQBNYsCqQs",
    Alibaba Cloud OSS documentation
    "storage_type": "s3_compatible",
}
```

### "storage\_url": "<https://ACCESS\\_KEY\\_ID:ACCESS\\_KEY\\_SECRET@BUCKET\\_NAME.oss-REGION.aliyuncs.com/FOLDER\\_NAME>"

S3 兼容存储设置 `如果您希望将结果传送到其他 S3 兼容的存储位置，您需要在有效载荷的` value 中包含您存储桶的 `storage_url` ACCESS\_KEY:SECRET

```json
{
    "source": "youtube_download",
    "query": "9cQBNYsCqQs",
    Alibaba Cloud OSS documentation
    身份验证字符串：

"storage_url": "https://ACCESS_KEY:SECRET@s3.oxylabs.io/my-videos"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.oxylabs.io/documentation/cn/zhua-qu-jie-jue-fang-an/web-scraper-api/targets/youtube/youtube-downloader.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
