Skip to main content

youtube-subtitle-yt-dlp

Extract subtitle files from YouTube video or playlist links using yt-dlp and authenticated cookies. Use when asked to download manual subtitles or auto captions from YouTube URLs and save them locally as subtitle files (for example .vtt/.srt).

설치로 이동

소스 정보

저장소
yang0/skill_youtube_topN_subtitle
최근 소스 활동
2026년 2월 28일 15:38
감지된 SKILL.md 언어
영어
스타
1
포크
1

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
3 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
youtube-subtitle-yt-dlp
description
Extract subtitle files from YouTube video or playlist links using yt-dlp and authenticated cookies. Use when asked to download manual subtitles or auto captions from YouTube URLs and save them locally as subtitle files (for example .vtt/.srt).
# Youtube Subtitle Yt Dlp ## Overview Use yt-dlp to download subtitle tracks only (no video download). Default cookie file is `H:\cookies\youtube.txt`. Output is written under project root `outputs/YYYY/MM/DD/subtitles/`. ## Install Dependencies ```bash pip install -U yt-dlp ``` ## Run ```bash python scripts/download_subtitles.py "https://www.youtube.com/watch?v=VIDEO_ID" ``` Common examples: - Manual subtitles only: ```bash python scripts/download_subtitles.py "<youtube-url>" --mode manual ``` - Auto captions only: ```bash python scripts/download_subtitles.py "<youtube-url>" --mode auto ``` - Convert to SRT: ```bash python scripts/download_subtitles.py "<youtube-url>" --convert-to srt ``` - Use a non-default cookie file: ```bash python scripts/download_subtitles.py "<youtube-url>" --cookies "D:\cookies\youtube.txt" ``` ## Output Contract - Download subtitle files only; do not download media streams. - Write files under project root `outputs/YYYY/MM/DD/subtitles/` by default. - Filename template is: `%(uploader|unknown)s/YYYYMMDD-%(title).180B [%(id)s].%(ext)s` - Keep original subtitle format unless `--convert-to` is set. ## Key Options - `--cookies <path>`: Path to YouTube cookies file. Default: `H:\cookies\youtube.txt`. - `--sub-langs <expr>`: Subtitle language selector. Default: `zh-Hans,zh-Hant,zh-CN,zh-TW,zh,en.*` - `--mode both|manual|auto`: Download manual subtitles, auto captions, or both. - `--no-playlist`: Force single-video behavior. - `--playlist-items <range>`: Select specific playlist items. - `--extra-arg "<yt-dlp-arg>"`: Pass extra yt-dlp flags. ## Troubleshooting - Cookie error: check that `H:\cookies\youtube.txt` exists, or override with `--cookies`. - Empty subtitle output: rerun with `--mode auto` to force automatic captions. - Region/login issues: pass proxy or geo args through `--extra-arg`, for example `--extra-arg "--proxy http://127.0.0.1:7890"`. - Need to inspect final command only: use `--dry-run`. ## Script - `scripts/download_subtitles.py`: Main entrypoint for subtitle extraction.
GitHub에서 보기