A Dart library to get transcripts/subtitles and video details for a given YouTube video.
This library allows you to get the transcript/subtitles for a given YouTube video. It also works for automatically generated subtitles and supports translating subtitles.
- Get transcripts for YouTube videos
- Get video details (title, description)
- Supports both manually created and automatically generated transcripts
- Translate transcripts
- No API key required
Add this to your pubspec.yaml file:
dependencies:
dartube:
git:
url: https://github.com/your-username/dartube.git
ref: mainimport 'package:dartube/dartube.dart';
void main() async {
// Get the transcript for a video.
final transcript = await Dartube.getTranscript('jNQXAC9IVRw');
for (var snippet in transcript.snippets) {
print('${snippet.start} - ${snippet.duration}: ${snippet.text}');
}
// Get video details
final videoDetails = await Dartube.getVideoDetails('jNQXAC9IVRw');
print('Title: ${videoDetails.title}');
print('Description: ${videoDetails.description}');
}This is an unofficial library.
Contributions are welcome! If you have suggestions for improvements, bug reports, or want to add new features, please open an issue or submit a pull request on GitHub.
If you encounter any issues or have questions, please file an issue on the GitHub Issues page. We aim to respond as quickly as possible.
You can find more information on the official GitHub page: https://github.com/definev/dartube