> 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/dai-li/high-bandwidth-proxies.md).

# 高带宽代理

## 开始使用

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

## 端点配置

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

* 一个专用代理端点
* 您的用户名和密码
* 端口号（默认： `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 %}

## 智能体技能

要在 AI 工作流中使用 Oxylabs 高带宽代理，你也可以使用 Agent Skills (`skills.md`) 来教会 LLM 和 AI 编码助手如何配置并与 Oxylabs 产品交互。

该 `video-data` 代理技能可帮助你的模型配置原始视频/音频媒体流传输和下载，通过 `yt-dlp` 不会产生语法或参数幻觉。

{% hint style="info" %}
**注意：** `video-data` 该技能还包括通过网页爬虫API进行结构化数据收集（搜索结果、元数据等）。 [了解更多](/products/cn/web-scraper-api/solutions-for-ai-workflows/agent-skills.md#video-data).
{% endhint %}

### 安装

#### Claude Code（插件市场）

在 Claude Code 中，运行以下命令：

```
/插件市场 添加 Oxylabs/agent-skills
/plugin 安装 oxylabs@oxylabs-agent-skills
```

这将所有 5 个技能作为单个插件安装：

* [`skills/代理`](https://github.com/oxylabs/agent-skills/blob/main/skills/proxies/SKILL.md)
* [`skills/web-unblocker`](https://github.com/oxylabs/agent-skills/blob/main/skills/web-unblocker/SKILL.md)
* [`skills/web-scraper-api`](https://github.com/oxylabs/agent-skills/blob/main/skills/web-scraper-api/SKILL.md)
* [`skills/无头浏览器`](https://github.com/oxylabs/agent-skills/blob/main/skills/headless-browser/SKILL.md)
* [`skills/video-data`](https://github.com/oxylabs/agent-skills/blob/main/skills/video-data/SKILL.md)

要更新技能，请运行此命令：

```
/plugin marketplace update oxylabs-agent-skills
```

#### 其他代理（通用）

对于其他代理和自定义环境，请通过标准 skills CLI 将仓库加载到您的项目工作区中：

```
npx skills add https://github.com/oxylabs/agent-skills.git
```

### 配置

所有 Oxylabs Agent Skills 都通过定义在一个 `.env` 文件。要使用 `video-data` 技能，请将这些键添加到你的 `.env` 文件：

| 变量                 | 描述                                                                                                                 |
| ------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `OXY_HB_ENDPOINT`  | 您的高带宽代理网关                                                                                                          |
| `OXY_WSA_USERNAME` | （可选）您的网页爬虫API用户 `用户名`. [了解更多](/products/cn/web-scraper-api/solutions-for-ai-workflows/agent-skills.md#video-data). |
| `OXY_WSA_PASSWORD` | （可选）您的网页爬虫API用户 `密码`. [了解更多](/products/cn/web-scraper-api/solutions-for-ai-workflows/agent-skills.md#video-data).  |

### 使用方法

启用该技能后，你可以提示你的 AI 助手生成针对网络优化的媒体传输脚本。

* **示例 1：** “创建一个 shell 脚本，将我的 `OXY_HB_ENDPOINT` 网关配置直接传入 `yt-dlp` 以从 URL 下载原始视频。”
* **示例 2：** “编写一个使用 `ffmpeg` 以及代理轮换，通过高带宽入口节点传输大型二进制视频资源。”


---

# 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 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/products/cn/dai-li/high-bandwidth-proxies.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.
