Back to media
media 2 min read 72 lines

youtube-content

YouTube 비디오 트랜스크립트 추출 및 콘텐츠 변환

YouTube Content Tool

Extract transcripts from YouTube videos and convert them into useful formats.

Setup

pip install youtube-transcript-api

Helper Script

SKILL_DIR is the directory containing this SKILL.md file. The script accepts any standard YouTube URL format, short links (youtu.be), shorts, embeds, live links, or a raw 11-character video ID.

# JSON output with metadata
python3 SKILL_DIR/scripts/fetch_transcript.py "https://youtube.com/watch?v=VIDEO_ID"

Plain text (good for piping into further processing)


python3 SKILL_DIR/scripts/fetch_transcript.py "URL" --text-only

With timestamps


python3 SKILL_DIR/scripts/fetch_transcript.py "URL" --timestamps

Specific language with fallback chain


python3 SKILL_DIR/scripts/fetch_transcript.py "URL" --language tr,en

Output Formats

After fetching the transcript, format it based on what the user asks for:

  • Chapters: Group by topic shifts, output timestamped chapter list
  • Summary: Concise 5-10 sentence overview of the entire video
  • Chapter summaries: Chapters with a short paragraph summary for each
  • Thread: Twitter/X thread format — numbered posts, each under 280 chars
  • Blog post: Full article with title, sections, and key takeaways
  • Quotes: Notable quotes with timestamps

Example — Chapters Output

00:00 Introduction — host opens with the problem statement
03:45 Background — prior work and why existing solutions fall short
12:20 Core method — walkthrough of the proposed approach
24:10 Results — benchmark comparisons and key takeaways
31:55 Q&A — audience questions on scalability and next steps

Workflow

  • Fetch the transcript using the helper script with --text-only --timestamps.
  • Validate: confirm the output is non-empty and in the expected language. If empty, retry without --language to get any available transcript. If still empty, tell the user the video likely has transcripts disabled.
  • Chunk if needed: if the transcript exceeds ~50K characters, split into overlapping chunks (~40K with 2K overlap) and summarize each chunk before merging.
  • Transform into the requested output format. If the user did not specify a format, default to a summary.
  • Verify: re-read the transformed output to check for coherence, correct timestamps, and completeness before presenting.

Error Handling

  • Transcript disabled: tell the user; suggest they check if subtitles are available on the video page.
  • Private/unavailable video: relay the error and ask the user to verify the URL.
  • No matching language: retry without --language to fetch any available transcript, then note the actual language to the user.
  • Dependency missing: run pip install youtube-transcript-api and retry.

Related Skills / 관련 스킬

media v1.1.0

gif-search

Tenor에서 GIF 검색/다운로드 — curl과 jq만으로 동작. 채팅용 반응 GIF에 유용.

media v1.0.0

heartmula

HeartMuLa 오픈소스 음악 생성 모델 — 가사+태그로 전체 곡 생성, 다국어 지원

media v1.0.0

songsee

오디오 파일에서 스펙트로그램 및 오디오 특징 시각화 생성 — mel, chroma, MFCC 등