f-person/youtube_caption_scraper
YouTubeから字幕/キャプションを解析するためのDartパッケージ
- Stars
- 19
- Forks
- 4
- 最終プッシュ(UTC)
- 2026/03/28
- プロジェクト状態
- 公開中
言語Dart
技術トピック
使用している依存関係
元の README
以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
README を開く / 閉じる
A Dart package that parses lyrics from YouTube. No authentication is required.
Usage
// Instantiate the scraper.
final captionScraper = YouTubeCaptionScraper();
// Fetch caption tracks – these are objects containing info like
// base url for the caption track and language code.
final captionTracks = await captionScraper.getCaptionTracks('video-url');
// Fetch the subtitles by providing it with a `CaptionTrack`
// from `getCaptionTracks`.
final subtitles = await captionScraper.getSubtitles(captionTracks[0]);
// Use the subtitles however you want.
for (final subtitle in subtitles) {
print('${subtitle.start} - ${subtitle.duration} - ${subtitle.text}');
}
For more info see example or check the API reference.
Credits
The package is heavily inspired by algolia/youtube-captions-scraper.