Xpersona
小

小米触屏闹钟视频制作

CLAWHUB · Unverified

B站视频下载裁剪压缩工具。下载bilibili视频、裁剪去除边框、压缩到指定大小时使用。支持b23.tv短链和BV号。别名:闹钟视频下载。 Skill: 小米触屏闹钟视频制作 Owner: mimose101 Summary: B站视频下载裁剪压缩工具。下载bilibili视频、裁剪去除边框、压缩到指定大小时使用。支持b23.tv短链和BV号。别名:闹钟视频下载。 Tags: latest:1.1.1 Version history: v1.1.1 | 2026-06-10T09:07:03.686Z | user **Summary: Improved B站视频下载兼容性,并适配多分辨率裁剪方案,清理冗余文件。** - 增加 bilix 作为 yt-dlp 反爬虫(HTTP 412)备用方案,提升下载成功率 - 新增各分辨率裁剪参数自动计算公式,支持 720P、1080P、480P、360P 等分辨率精确裁剪 - 细化 b23.tv 短链解析和手动处理流程说明 - 删除冗余脚本和 skill-card.md 文件,减少复杂度 - 保持下载文件名唯一性防止被覆盖,所

62
Rank
84
Safety
1.2k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s174rbezqj5857hkv5fxk58d9984h75y:xiaomi-touchscreen-alarm-clock-video-production
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-mimose101-xiaomi-touchscreen-alarm-clock-video-producti/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

19,200 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: bilibili-video-download
description: B站视频下载裁剪压缩工具。下载bilibili视频、裁剪去除边框、压缩到指定大小时使用。支持b23.tv短链和BV号。别名:闹钟视频下载。
---

# 闹钟视频下载

## 依赖

- yt-dlp: `py -m pip install yt-dlp`
- bilix (备用): `pip install bilix --break-system-packages`
- ffmpeg/ffprobe: 需在PATH中

## 工作流

### 1. 下载视频

#### 方法A: yt-dlp(推荐,但可能遇到反爬虫)

固定下载720P分辨率视频(格式ID: 30064+30280),文件名使用BV号:
```
py -m yt_dlp -f "30064+30280" -o "PATH/%(id)s.%(ext)s" --merge-output-format mp4 URL
```
说明: 30064为720P视频流,30280为音频流。使用 `%(id)s` 自动提取BV号作为文件名,避免多个视频下载时文件名冲突。

**注意:** yt-dlp 可能遇到 HTTP 412 错误(B站反爬虫机制),此时使用方法B。

#### 方法B: bilix(备用,稳定性更好)

当 yt-dlp 返回 `HTTP Error 412: Precondition Failed` 时,使用 bilix 下载:
```bash
pip install bilix --break-system-packages
bilix get_video "https://www.bilibili.com/video/BV号" -d 输出目录
```

**b23.tv短链处理:** bilix 不直接支持短链,需先解析获取BV号:
```bash
curl -sI "https://b23.tv/短链ID" | grep -i location
# 从返回的location中提取BV号
```

### 2. 裁剪边框(可选)

使用裁剪参数去除B站视频边框,格式为 `宽:高:左:上`。

#### 720P视频固定参数

默认裁剪参数 `792:600:432:56`(针对1280x720视频):
```
ffmpeg -y -i IN -vf "crop=792:600:432:56" -c:v libx264 -crf 18 -c:a copy OUT
```

#### 非720P视频裁剪参数计算

720P裁剪参数的比例:
| 参数 | 720P值 | 比例 |
|------|--------|------|
| 裁剪宽度 | 792 | 61.875% (0.61875) |
| 裁剪高度 | 600 | 83.33% (0.83333) |
| 左偏移 | 432 | 33.75% (0.3375) |
| 上偏移 | 56 | 7.78% (0.07778) |

**通用计算公式:**
```python
video_width = 852   # 实际视频宽度
video_height = 480  # 实际视频高度

crop_w = int(video_width * 0.61875)   # 裁剪宽度
crop_h = int(video_height * 0.83333)  # 裁剪高度
crop_x = int(video_width * 0.3375)    # 左偏移
crop_y = int(video_height * 0.07778)  # 上偏移

# 结果: crop=527:400:287:37
```

**常见分辨率适配参数:**

| 分辨率 | 裁剪参数 | 输出尺寸 |
|--------|---------|---------|
| 1280x720 (720P) | `792:600:432:56` | 792x600 |
| 1920x1080 (1080P) | `1188:900:648:84` | 1188x900 |
| 852x480 | `527:400:287:37` | 527x400 |
| 640x360 (360P) | `396:300:216:28` | 396x300 |

**裁剪命令示例(852x480视频):**
```
ffmpeg -y -i IN -vf "crop=527:400:287:37" -c:v libx264 -crf 18 -c:a copy OUT
```

如无需裁剪,传入 `--no-crop`。

### 3. 剪切视频(可选,默认去除前后各10秒)

**步骤1: 去除前10秒**
```
ffmpeg -y -i IN -ss 00:00:10 -c:v libx264 -crf 18 -c:a copy TEMP
```

**步骤2: 获取剩余视频时长**
```
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 TEMP
```

**步骤3: 去除后10秒(总时长-10)**
```
ffmpeg -y -i TEMP -t (duration-10) -c:v libx264 -crf 18 -c:a copy OUT
```

说明: 固定去除片头10秒和片尾10秒,总时长减少20秒。如无需剪切,传入 `--no-trim`。

### 4. 压缩到目标大小

**目标:压缩到10MB以内**

**步骤1: 获取视频时长**
```
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 INPUT_VIDEO
```

**步骤2: 计算动态码率**
使用Python计算码率参数(以目标10MB为例):
```python
target_MB = 10
duration = 217.345783  # 从步骤1获取的实际时长
vbr = max(int((target_MB * 0.9 * 8 * 1024) / duration - 64), 100)  # 视频码率
maxrate = int(vbr * 1.25)  # 最大码率
bufsize = int(vbr * 2.5)   # 缓冲大小
# 示例输出: vbr=275k, maxrate=344k, bufsize=688k
```

计算公式:
- 视频码率: `vbr = max(int((target_MB * 0.9 * 8 * 1024) / duration - 64), 100)`
- 最大码率: `maxrate = int(vbr * 1.25)`
- 缓冲大小: `bufsize = int(vbr * 2.5)`

**步骤3: 执行压缩**

_meta.json

{
  "ownerId": "kn7bte3s1j00sha7b3twyxkrcn84g16h",
  "slug": "xiaomi-touchscreen-alarm-clock-video-production",
  "version": "1.1.1",
  "publishedAt": 1781082423686
}

skill-card.md

## Description:

B站视频下载裁剪压缩工具。下载bilibili视频、裁剪去除边框、压缩到指定大小时使用。支持b23.tv短链和BV号。别名:闹钟视频下载。

This skill is ready for commercial/non-commercial use.

## Publisher:

[mimose101](https://clawhub.ai/user/mimose101)

### License/Terms of Use:

MIT-0

## Use Case:

External users and developers use this skill to guide agents through downloading Bilibili videos, resolving b23.tv short links, cropping video borders, trimming lead-in and end segments, and compressing output for a Xiaomi touchscreen alarm clock workflow.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Dependency installation can modify the user's Python environment.

Mitigation: Install dependencies in a dedicated virtual environment and avoid --break-system-packages.

Risk: ffmpeg commands use overwrite mode and repeated runs for the same BV ID can replace previous outputs.

Mitigation: Choose output filenames and directories carefully, keep BV-based unique filenames, and check for existing files before rerunning processing.

## Reference(s):

- [ClawHub Skill Page](https://clawhub.ai/mimose101/skills/xiaomi-touchscreen-alarm-clock-video-production)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, configuration, guidance]

**Output Format:** [Markdown guidance with inline shell commands, parameter tables, and bitrate formulas]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Outputs may include yt-dlp, bilix, ffmpeg, ffprobe, curl, and Python command examples for local media processing.]

## Skill Version(s):

1.1.1 (source: release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to 小米触屏闹钟视频制作 and adjacent AI workflows.