Logo Lai Youtube

Lai Youtube

Tổ chức
lattifai
lai-youtube

One-command YouTube pipeline — downloads media, fetches or transcribes captions, and runs forced alignment. Trigger when the user provides a YouTube URL (youtube.com / youtu.be) and wants captions/subtitles, or says "align youtube", "下载YouTube字幕", "get captions from youtube".

Tổng quan

Nhà phát hànhlattifai
Kho mãlattifai-skills
Tên kỹ nănglai-youtube
Sao
32
Bản fork
1
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được lattifai công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Lai Youtube trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/lattifai/lattifai-skills/tree/main/skills/lai-youtube
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lattifai/lattifai-skills.git /tmp/lattifai-skills
mkdir -p .claude/skills
cp -r /tmp/lattifai-skills/skills/lai-youtube .claude/skills/lai-youtube
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Lai Youtube trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Lai Youtube ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Lai Youtube với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

YouTube Workflow

YouTube URL → aligned captions in one command. Requires an API key (/lai-setup) and yt-dlp (pip install yt-dlp).

File path convention

All outputs land in the current directory by default (no subdirectories). Use the YouTube video ID as <base> and chain pipeline files as <base>.<derivation>.<ext>:

<base>.mp4              # downloaded media
<base>.en.vtt           # YouTube auto-caption
<base>.meta.md          # metadata
<base>.aligned.json     # forced-alignment output (when caption.output.format=json)
<base>.srt              # final SRT (when caption.output.format=srt)

<base> is the YouTube ID (e.g. la0CaZ2R8EY); the agent extracts it from the URL.

Basic Command

This command uses nemo_run config syntax (key=value), not -o / --output.

bash
# `<base>` = la0CaZ2R8EY (the YouTube video ID)
lai youtube align "https://youtu.be/la0CaZ2R8EY" \
    caption.output.path=la0CaZ2R8EY.aligned.json \
    caption.output.format=json
# shortcut:
lai-youtube "https://youtu.be/la0CaZ2R8EY" caption.output.path=la0CaZ2R8EY.aligned.json

Add -Y (skip confirmation) for non-interactive runs. caption.output.format is inferred from the path suffix but passing it explicitly is safest. Supported: srt, vtt, ass, json, ttml, lrc, … (see /lai-caption).

Pipeline steps

  1. yt-dlp downloads media into the current directory by default (media.output_dir=.); files named <video_id>.mp4 etc.
  2. Fetch YouTube captions (or transcribe with Gemini if use_transcription=true)
  3. Lattice-1 forced alignment
  4. Write in the requested format

Check What's Available First

bash
yt-dlp --list-subs "URL"
  • Manual captions → best quality, use defaults
  • Auto-captions only → consider caption.input.split_sentence=true if the auto-captions break mid-sentence and you want cleaner segments for downstream karaoke / translation / summarization. Default in examples is false to preserve the source's original cue boundaries
  • No captions → add use_transcription=true (needs a Gemini key — see /lai-transcribe)

Common Options

All use key=value syntax, dot-nested:

  • use_transcription=true — transcribe with Gemini instead of using YouTube captions
  • caption.input.split_sentence=false (default in examples) — preserve source cue boundaries. Set to true to re-segment into clean sentences (helpful for messy auto-captions)
  • caption.render.word_level=true — per-word timestamps (needed for karaoke; pair with a JSON or ASS output)
  • caption.output.path=<base>.aligned.json / caption.output.format=json — output destination (use <base>.<derivation>.<ext> naming)
  • media.prefer_audio=true — audio-only download (faster, smaller)
  • media.prefer_audio=false — keep the video. Pair with media.output_format=mp4 explicitly; prefer_audio=false alone may still emit audio-only output, which breaks downstream karaoke (no width/height for probe_media.py)
  • media.output_dir=. — where downloaded audio / vtt land (default: current directory)
  • media.streaming_chunk_secs=300 — long-video chunking

Full list: lai youtube align --help. Discover the full config tree with lai youtube align --to-yaml /tmp/cfg.yaml URL (exports and exits without running).

Download Only (lai youtube download)

When you need just the media (no alignment), or want to manage the media + caption files yourself:

bash
lai youtube download --direct -Y \
    yt_url="https://youtu.be/la0CaZ2R8EY" \
    media.output_dir=. \
    media.output_format=mp4 \
    media.prefer_audio=false
  • media.output_format: mp4 (default with prefer_audio=false), mp3, wav, …
  • only=meta — re-download metadata only (writes <id>.meta.md, no media)

The downloaded files follow the pattern <id>.mp4, <id>.en.vtt, <id>.meta.md inside media.output_dir (current directory by default). Pipe the pair into /lai-align afterwards.

Karaoke Recipe (end-to-end)

<base> = YouTube video ID (e.g. la0CaZ2R8EY):

bash
# Step 1 — YouTube → aligned JSON with word-level timestamps
lai youtube align -Y "https://youtu.be/la0CaZ2R8EY" \
    caption.output.path=la0CaZ2R8EY.aligned.json \
    caption.output.format=json \
    caption.input.split_sentence=false \
    caption.render.word_level=true

# Step 2 — JSON → ASS with per-word karaoke highlighting (see /lai-caption)
laicap-convert -Y la0CaZ2R8EY.aligned.json la0CaZ2R8EY.karaoke.ass \
    ass.karaoke_effect=sweep \
    ass.karaoke_color_scheme=azure-gold

(render.word_level is not needed on the convert side — it's default word-scope. The upstream caption.render.word_level=true in Step 1 is what populates the words arrays that karaoke reads.)

For bilingual karaoke, run /lai-translate on la0CaZ2R8EY.aligned.json first (it preserves words), then run step 2 on the bilingual JSON.

Operational Tips

For long alignments (Step 3 lattice search can take minutes on long-form video), redirect to a log file so you can see EXIT code and stderr after truncation:

bash
lai youtube align -Y URL caption.output.path=la0CaZ2R8EY.aligned.json ... > la0CaZ2R8EY.align.log 2>&1
echo "EXIT=$?"
tail -50 la0CaZ2R8EY.align.log

Common Issues

ProblemFix
yt-dlp not installedpip install yt-dlp
Video private / unavailableURL must be publicly accessible
No captions and no Gemini keySet one up — see /lai-transcribe
Region-restrictedUse a VPN or fetch from an unrestricted region
Age-restrictedyt-dlp --cookies-from-browser chrome to download, then /lai-align
API key invalid/lai-setup
media.prefer_audio=false but downloaded file is still mp3 / m4aAdd media.output_format=mp4 explicitly — they're separate flags
Couldn't load entrypoint youtube: No module named 'lattifai' on lai startupStale editable install — see /lai-setup Common Issues

Related Skills

  • /lai-setup — first-time install and auth
  • /lai-align — when media + captions are already local
  • /lai-transcribe — transcribe without alignment (Gemini accepts YouTube URLs too)
  • /lai-diarize — speaker labels on aligned output
  • /lai-translate — translate captions
  • /lai-caption — convert output format

Câu hỏi thường gặp

Kỹ năng AI Lai Youtube làm được gì?

One-command YouTube pipeline — downloads media, fetches or transcribes captions, and runs forced alignment. Trigger when the user provides a YouTube URL (youtube.com / youtu.be) and wants captions/subtitles, or says "align youtube", "下载YouTube字幕", "get captions from youtube".

Vì sao nên dùng Lai Youtube trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Lai Youtube là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Lai Youtube trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/lattifai/lattifai-skills/tree/main/skills/lai-youtube. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Lai Youtube?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Lai Youtube với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Lai Youtube với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Lai Youtube có miễn phí không?

Có. Kỹ năng này được lattifai phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇