Claude Code Tools

yt2bb

github

YouTube to Bilibili video repurposing with bilingual subtitles

Stars
⭐ 40
License
MIT
Last Updated
2026-05-20
Source
github

yt2bb - YouTube to Bilibili Video Repurposing

中文文档

A Claude Code skill that repurposes YouTube videos for Bilibili with bilingual (EN/ZH) hardcoded subtitles.

Compatible with Claude Code, OpenClaw, Hermes Agent, Pi (pi-mono), and indexed by SkillsMP.

Workflow

YouTube → yt-dlp → whisper → validate → translate → merge → ffmpeg → publish_info → Bilibili
StepToolOutput
Downloadyt-dlp.mp4
Transcribewhisper_{lang}.srt
Validate/Fixsrt_utils.py_{lang}.srt (fixed)
TranslateAI_zh.srt
Mergesrt_utils.py_bilingual.srt
Burnffmpeg_bilingual.mp4
Publish InfoAIpublish_info.md

Usage

/yt2bb https://www.youtube.com/watch?v=VIDEO_ID

Installation

Claude Code

git clone https://github.com/Agents365-ai/yt2bb.git ~/.claude/skills/yt2bb

OpenClaw

git clone https://github.com/Agents365-ai/yt2bb.git ~/.openclaw/skills/yt2bb

Hermes Agent

git clone https://github.com/Agents365-ai/yt2bb.git ~/.hermes/skills/media/yt2bb

Pi (pi-mono)

git clone https://github.com/Agents365-ai/yt2bb.git ~/.pi/agent/skills/yt2bb

Prerequisites

Utility Script

# Detect platform and recommend whisper backend + model
python3 srt_utils.py check-whisper

# Merge EN and ZH subtitles
python3 srt_utils.py merge en.srt zh.srt output.srt

# Validate timing issues
python3 srt_utils.py validate input.srt

# Lint against Netflix Timed Text Style Guide (CPS, duration, line length, gaps)
python3 srt_utils.py lint bilingual.srt

# Fix timing overlaps
python3 srt_utils.py fix input.srt output.srt

# Convert to styled ASS (presets: netflix, clean, glow)
# Presets stay bottom-aligned and scale with resolution
# `netflix` = broadcast-grade: white text, thin outline, soft shadow, no box
python3 srt_utils.py to_ass bilingual.srt bilingual.ass --preset netflix
python3 srt_utils.py to_ass bilingual.srt bilingual.ass --style-file custom.ass

# Generate slug from title
python3 srt_utils.py slugify "Video Title"

All subcommands support --format json for structured agent-friendly output. merge and to_ass support --dry-run to validate inputs without writing files.

Subtitle Preset Previews

All three presets rendered on the same 1920×1080 background, so you can compare typography, layout, and contrast at a glance.

PresetPreviewUse case
netflixnetflix preset previewDefault for professional content. Pure white text, thin black outline, soft drop shadow, no box. Modeled on the Netflix Timed Text Style Guide. Best for documentaries, interviews, and long-form video.
cleanclean preset previewReadability safety net. Golden-yellow text on a semi-transparent gray box. Use when netflix’s outline could get visually lost on busy or bright-heavy footage — the box guarantees a contrast pad.
glowglow preset previewEntertainment / vlog. Yellow ZH + white EN with a colored outer glow. Most eye-catching, least subtle — best for high-energy edits and B站-style content.

To regenerate these images after changing a preset, run:

bash docs/presets/render_previews.sh

The script renders each preset against a neutral gradient background using the committed docs/presets/sample.srt fixture and writes docs/presets/{preset}.png.

License

MIT License

Support

If this project helps you, consider supporting the author:

WeChat Pay
WeChat Pay
Alipay
Alipay
Buy Me a Coffee
Buy Me a Coffee

探索未至之境

GitHub Bilibili