Rechercher

PythonReactSEOPDF
OpenClaw

cdn-url-transfer

将模型配置中的外部示例 URL(fal.media、googleapis 等)转存到速推 CDN(cdn-video.51sux.com),并更新代码和校验 API 返回。当用户提到"转存 CDN"、"替换示例链接"、"转存链接"、"CDN 地址"、"示例 URL 替换"时使用此 skill。

hexiaochun0 installations selon la source☆ 0 Étoiles du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install hexiaochun/cdn-url-transfer

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

Instructions

模型示例 URL 转存 CDN

将模型配置中的外部文件链接(fal.media、googleapis 等)转存到速推 CDN,确保示例资源稳定可访问。

需替换的 URL 位置

每个模型最多有 3 处 URL 需要替换,全部在 model_registry.py 中:

位置 字段 说明
1 parameters[].examples 输入参数的示例值(图片/视频 URL)
2 output_example 输出结果示例中的媒体 URL
3 executor 的 get_params_schema() 执行器中的参数 schema(与位置 1 保持同步)

关键文件:

  • 主数据源(docs API 读取):translate_api/app/api/v3/transports/mcp/model_registry.py
  • 执行器(运行时使用):translate_api/app/api/v3/executors/ 下对应的 executor 文件

操作流程

Step 1: 扫描目标模型的外部 URL

用 Grep 在 model_registry.py 中搜索目标模型相关的外部域名:

搜索模式: fal\.media|googleapis\.com|其他外部域名
范围: model_registry.py 中目标模型的注册块

同时搜索对应 executor 文件中的 examples 字段。

Step 2: 上传文件到 CDN
方案 A:MCP upload_image 工具(仅限小图片 base64)

已知问题:upload_image 的 image_url 参数(URL 转存模式)经常失败,返回空错误。 仅 image_data(base64 模式)可靠,但受工具参数大小限制,仅适合 < 100KB 的小图片。

upload_image(
  image_data="<base64字符串>",
  file_name="模型名_用途.png",
  folder="模型名-examples"
)
方案 B:curl 下载 + TOS Python SDK 直传(推荐)

这是最可靠的方案,支持任意文件类型和大小(图片、音频、视频)。

第一步:用 curl 下载到本地(curl 不走 Python 代理,更稳定)

curl -sL -o /tmp/文件名.png "原始外部URL"
curl -sL -o /tmp/文件名.mp3 "原始外部URL"

第二步:用 TOS SDK 上传到 CDN

import tos

TOS_CONFIG = {
    'access_key': 'AKLTZTBhMDdlYTdlODdlNGFlNGFjNTliOGEwOWFkNzk0Mjk',
    'secret_key': 'TnpVMk9EUmtNREkzWmpjNU5EazVNVGxsTkRnMk9XUXlZMk15WldRNVpqUQ==',
    'endpoint': 'tos-cn-guangzhou.volces.com',
    'region': 'cn-guangzhou',
    'bucket_name': 'fal-task',
    'public_domain': 'https://cdn-video.51sux.com'
}

client = tos.Tos...

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/hexiaochun/cdn-url-transfer
Version
—
Commit
9d3e5d6f70f70923301e845e5743dcca732b3a61
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

Contenu extrait

SKILL.md
# 模型示例 URL 转存 CDN

将模型配置中的外部文件链接(fal.media、googleapis 等)转存到速推 CDN,确保示例资源稳定可访问。

## 需替换的 URL 位置

每个模型最多有 **3 处** URL 需要替换,全部在 `model_registry.py` 中:

| 位置 | 字段 | 说明 |
|------|------|------|
| 1 | `parameters[].examples` | 输入参数的示例值(图片/视频 URL) |
| 2 | `output_example` | 输出结果示例中的媒体 URL |
| 3 | executor 的 `get_params_schema()` | 执行器中的参数 schema(与位置 1 保持同步) |

**关键文件:**
- **主数据源**(docs API 读取):`translate_api/app/api/v3/transports/mcp/model_registry.py`
- **执行器**(运行时使用):`translate_api/app/api/v3/executors/` 下对应的 executor 文件

## 操作流程

### Step 1: 扫描目标模型的外部 URL

用 Grep 在 `model_registry.py` 中搜索目标模型相关的外部域名:

```
搜索模式: fal\.media|googleapis\.com|其他外部域名
范围: model_registry.py 中目标模型的注册块
```

同时搜索对应 executor 文件中的 `examples` 字段。

### Step 2: 上传文件到 CDN

#### 方案 A:MCP `upload_image` 工具(仅限小图片 base64)

> **已知问题**:`upload_image` 的 `image_url` 参数(URL 转存模式)**经常失败**,返回空错误。
> 仅 `image_data`(base64 模式)可靠,但受工具参数大小限制,仅适合 **< 100KB** 的小图片。

```
upload_image(
  image_data="<base64字符串>",
  file_name="模型名_用途.png",
  folder="模型名-examples"
)
```

#### 方案 B:curl 下载 + TOS Python SDK 直传(推荐)

这是最可靠的方案,支持**任意文件类型和大小**(图片、音频、视频)。

**第一步:用 curl 下载到本地**(curl 不走 Python 代理,更稳定)

```bash
curl -sL -o /tmp/文件名.png "原始外部URL"
curl -sL -o /tmp/文件名.mp3 "原始外部URL"
```

**第二步:用 TOS SDK 上传到 CDN**

```python
import tos

TOS_CONFIG = {
    'access_key': 'AKLTZTBhMDdlYTdlODdlNGFlNGFjNTliOGEwOWFkNzk0Mjk',
    'secret_key': 'TnpVMk9EUmtNREkzWmpjNU5EazVNVGxsTkRnMk9XUXlZMk15WldRNVpqUQ==',
    'endpoint': 'tos-cn-guangzhou.volces.com',
    'region': 'cn-guangzhou',
    'bucket_name': 'fal-task',
    'public_domain': 'https://cdn-video.51sux.com'
}

client = tos.Tos...

Skills associés

OpenClaw

humanpages

human-pages-ai

Search and hire real humans for tasks — photography, delivery, research, and more

OpenClaw

openclaw-skills

zseven-w

Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.

OpenClaw

0xarchive

0xfantommenace

Query historical crypto market data from 0xArchive across Hyperliquid, Lighter.xyz, and HIP-3. Covers orderbooks, trades, candles, funding rates, open interest, liquidations, and data quality. Use when the user...

OpenClaw

1sec-security

cutmob

Install, configure, and manage 1-SEC — an open-source, all-in-one cybersecurity platform (16 modules, single binary) on Linux servers and VPS instances. Use when the user asks to secure a server, install securi...