> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/products/cn/proxies/high-bandwidth-proxies.md).

# 高带宽代理

了解如何将 Oxylabs 高带宽代理用于视频和音频抓取等流量密集型任务。

## 入门

要开始使用我们的 [**高带宽代理**](https://oxylabs.io/products/high-bandwidth-proxies) 用于视频数据和音频抓取，请联系我们的销售团队以获取您的专用 Proxy Endpoint。每位客户都会获得一个根据其特定需求配置的唯一 Proxy Endpoint。要将此解决方案直接集成到 `yt_dlp` 库，请查看 [示例](#example-integration-youtube-downloader) 下方，或查看我们的 [智能体技能](#agent-skills) 用于 AI 工作流。

## Endpoint 配置

在从客户管理团队收到您的端点后，您将获得：

* 专用 Proxy Endpoint
* 您的用户名和密码
* 端口号（默认： `60000`)

## 示例集成：YouTube 下载器

下面是一个使用 `yt-dlp` 使用我们的高带宽代理进行视频或音频数据抓取：

### 基本用法

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

```bash
yt-dlp --proxy username-$(openssl rand -hex 16):password@endpoint:60000 \\
"https://www.youtube.com/watch?v=WNCl-69POro"
```

{% endtab %}

{% tab title="Python" %}

```python
import os
import yt_dlp

username = 'YOUR_USERNAME'
password = 'YOUR_PASSWORD'

proxy = f'http://{username}-{os.urandom(16).hex()}:{password}@your-endpoint:60000'

ydl_opts = {
    'proxy': proxy,
}

with yt_dlp.YoutubeDL(ydl_opts) as ydl:
    ydl.download(['https://www.youtube.com/watch?v=WNCl-69POro'])
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
为获得最佳性能，请确保每个视频都使用单独的 IP 地址下载。请参考下方部分了解指导。
{% endhint %}

### 使用不同 IP 的多个 URL

使用高带宽代理时，每个视频都会使用单独的 IP 地址下载，以确保最佳性能。通过为每个请求生成唯一的会话 ID 来实现，这实际上会为每次下载分配一个新的 IP 地址。

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

```bash
# First video with one IP
yt-dlp --proxy username-$(openssl rand -hex 16):password@endpoint:60000 \\
"https://www.youtube.com/watch?v=6stlCkUDG_s"

# Second video with different IP
yt-dlp --proxy username-$(openssl rand -hex 16):password@endpoint:60000 \\
"https://www.youtube.com/watch?v=gsnqXt7d1mU"
```

{% endtab %}

{% tab title="Python" %}

```python
import os
import yt_dlp

def download_with_new_ip(url, username, password):
    session_id = os.urandom(16).hex()
    proxy = f'http://{username}-{session_id}:{password}@your-endpoint:60000'

    ydl_opts = {
        'proxy': proxy
    }
    
    with yt_dlp.YoutubeDL(ydl_opts) as ydl:
        try:
            print(f"Downloading {url} with new IP ({username}-{session_id})...")
            ydl.download([url])
            print(f"Successfully downloaded {url}")
        except Exception as e:
            print(f"Error downloading {url}: {str(e)}")

def main():
    username = 'YOUR_USERNAME'
    password = 'YOUR_PASSWORD'
    
    videos = [
        'https://www.youtube.com/watch?v=6stlCkUDG_s',
        'https://www.youtube.com/watch?v=gsnqXt7d1mU'
    ]
    
    for video in videos:
        download_with_new_ip(video, username, password)

if __name__ == "__main__":
    main()

```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
该函数包含基本错误处理，以确保即使一个下载失败，流程仍会继续。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.oxylabs.io/products/cn/proxies/high-bandwidth-proxies.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
