/dartube

Primary LanguageDartMIT LicenseMIT

Dartube

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.

Features

  • Get transcripts for YouTube videos
  • Get video details (title, description)
  • Supports both manually created and automatically generated transcripts
  • Translate transcripts
  • No API key required

Installation

Add this to your pubspec.yaml file:

dependencies:
  dartube:
    git:
      url: https://github.com/your-username/dartube.git
      ref: main

Usage

import '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}');
}

Additional information

This is an unofficial library.

Contributing

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.

Support

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.

Where to find more information

You can find more information on the official GitHub page: https://github.com/definev/dartube