{"id":48923272,"url":"https://github.com/pandaxbacon/youtube-transcript-dart","last_synced_at":"2026-04-17T05:31:57.191Z","repository":{"id":327256985,"uuid":"1108535299","full_name":"pandaxbacon/youtube-transcript-dart","owner":"pandaxbacon","description":"A Dart library to fetch YouTube transcripts and subtitles. Works with auto-generated and manually created transcripts.","archived":false,"fork":false,"pushed_at":"2025-12-09T09:33:48.000Z","size":433,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-10T06:39:19.260Z","etag":null,"topics":["captions","dart","flutter","subtitles","transcript","youtube","youtube-api","youtube-captions","youtube-subtitles","youtube-transcript"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pandaxbacon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":null},"created_at":"2025-12-02T15:22:45.000Z","updated_at":"2025-12-02T18:18:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pandaxbacon/youtube-transcript-dart","commit_stats":null,"previous_names":["pandaxbacon/youtube-transcript-dart"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pandaxbacon/youtube-transcript-dart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaxbacon%2Fyoutube-transcript-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaxbacon%2Fyoutube-transcript-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaxbacon%2Fyoutube-transcript-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaxbacon%2Fyoutube-transcript-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pandaxbacon","download_url":"https://codeload.github.com/pandaxbacon/youtube-transcript-dart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaxbacon%2Fyoutube-transcript-dart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31916772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captions","dart","flutter","subtitles","transcript","youtube","youtube-api","youtube-captions","youtube-subtitles","youtube-transcript"],"created_at":"2026-04-17T05:31:55.743Z","updated_at":"2026-04-17T05:31:57.183Z","avatar_url":"https://github.com/pandaxbacon.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ✨ YouTube Transcript API (Dart) ✨\n\n[![Pub Version](https://img.shields.io/pub/v/youtube_transcript_api?color=blue)](https://pub.dev/packages/youtube_transcript_api)\n[![Dart CI](https://github.com/pandaxbacon/youtube-transcript-dart/workflows/Dart%20CI/badge.svg)](https://github.com/pandaxbacon/youtube-transcript-dart/actions)\n[![Coverage](https://img.shields.io/codecov/c/github/pandaxbacon/youtube-transcript-dart)](https://codecov.io/gh/pandaxbacon/youtube-transcript-dart)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Dart Version](https://img.shields.io/badge/dart-%3E%3D3.0.0-blue)](https://dart.dev)\n\n**A Dart library to fetch YouTube transcripts and subtitles. Works with auto-generated and manually created transcripts. No API key required!**\n\nThis is a Dart port of the popular Python library [youtube-transcript-api](https://github.com/jdepoix/youtube-transcript-api).\n\n## Features\n\n- ✅ Fetch transcripts for any YouTube video\n- ✅ Support for both manually created and auto-generated subtitles\n- ✅ Multiple language support with automatic fallback\n- ✅ Translation support for available transcripts\n- ✅ Multiple output formats (Text, JSON, WebVTT, SRT, CSV)\n- ✅ Proxy support (including Webshare rotating proxies)\n- ✅ No API key required\n- ✅ Works in both Dart and Flutter applications\n- ✅ Command-line interface included\n- ✅ Bypasses YouTube's PoToken protection using InnerTube API\n\n## Installation\n\nAdd this to your package's `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  youtube_transcript_api: ^1.0.0\n```\n\nThen run:\n\n```bash\ndart pub get\n```\n\nOr for Flutter:\n\n```bash\nflutter pub get\n```\n\n## Quick Start\n\n```dart\nimport 'package:youtube_transcript_api/youtube_transcript_api.dart';\n\nvoid main() async {\n  final api = YouTubeTranscriptApi();\n  \n  try {\n    // Fetch transcript for a video\n    final transcript = await api.fetch('dQw4w9WgXcQ');\n    \n    // Print each snippet\n    for (var snippet in transcript) {\n      print('[${snippet.start}] ${snippet.text}');\n    }\n  } finally {\n    api.dispose();\n  }\n}\n```\n\n## Usage\n\n### Fetch Transcripts with Language Preference\n\n```dart\n// Try to fetch German transcript, fallback to English\nfinal transcript = await api.fetch(\n  'dQw4w9WgXcQ',\n  languages: ['de', 'en'],\n);\n```\n\n### List Available Transcripts\n\n```dart\nfinal transcriptList = await api.list('dQw4w9WgXcQ');\n\nfor (var transcript in transcriptList) {\n  print('${transcript.language} [${transcript.languageCode}]');\n  print('  Generated: ${transcript.isGenerated}');\n  print('  Translatable: ${transcript.isTranslatable}');\n}\n```\n\n### Find Specific Transcript Types\n\n```dart\n// Find manually created transcript\nfinal manual = await api.findManuallyCreatedTranscript(\n  'dQw4w9WgXcQ',\n  ['en'],\n);\n\n// Find auto-generated transcript\nfinal generated = await api.findGeneratedTranscript(\n  'dQw4w9WgXcQ',\n  ['en'],\n);\n```\n\n### Translate Transcripts\n\n```dart\nfinal transcriptList = await api.list('dQw4w9WgXcQ');\nfinal transcript = transcriptList.findTranscript(['en']);\n\n// Translate to German\nfinal germanTranscript = transcript.translate('de');\nfinal fetched = await germanTranscript.fetch();\n```\n\n### Using Formatters\n\n```dart\nfinal transcript = await api.fetch('dQw4w9WgXcQ');\n\n// Plain text\nfinal textFormatter = TextFormatter();\nprint(textFormatter.format(transcript));\n\n// JSON\nfinal jsonFormatter = JsonFormatter(pretty: true);\nprint(jsonFormatter.format(transcript));\n\n// WebVTT\nfinal vttFormatter = VttFormatter();\nprint(vttFormatter.format(transcript));\n\n// SRT\nfinal srtFormatter = SrtFormatter();\nprint(srtFormatter.format(transcript));\n\n// CSV\nfinal csvFormatter = CsvFormatter();\nprint(csvFormatter.format(transcript));\n```\n\n### Using Proxies\n\n#### Generic Proxy\n\n```dart\nfinal api = YouTubeTranscriptApi(\n  proxyConfig: GenericProxyConfig(\n    httpUrl: 'http://proxy.example.com:8080',\n    httpsUrl: 'https://proxy.example.com:8443',\n  ),\n);\n```\n\n#### Webshare Rotating Proxy\n\n```dart\nfinal api = YouTubeTranscriptApi(\n  proxyConfig: WebshareProxyConfig(\n    username: 'your-username',\n    password: 'your-password',\n    location: 'US', // Optional location filter\n  ),\n);\n```\n\n## Command-Line Interface\n\n### Installation\n\nActivate the package globally:\n\n```bash\ndart pub global activate youtube_transcript_api\n```\n\n### Usage\n\n```bash\n# Fetch transcript as plain text\nyoutube_transcript_api dQw4w9WgXcQ\n\n# Fetch in specific language\nyoutube_transcript_api dQw4w9WgXcQ -l de\n\n# List available transcripts\nyoutube_transcript_api dQw4w9WgXcQ --list\n\n# Save as JSON file\nyoutube_transcript_api dQw4w9WgXcQ -f json -o transcript.json\n\n# Save as SRT subtitle file\nyoutube_transcript_api dQw4w9WgXcQ -f srt -o subtitle.srt\n\n# Multiple languages with fallback\nyoutube_transcript_api dQw4w9WgXcQ -l de,en,fr\n```\n\n### CLI Options\n\n```\n-v, --video-id          YouTube video ID\n-l, --languages         Comma-separated language codes (default: en)\n-f, --format            Output format: text, json, vtt, srt, csv\n                        (default: text)\n-o, --output            Output file path (default: stdout)\n    --list              List all available transcripts\n    --manual-only       Only fetch manually created transcripts\n    --generated-only    Only fetch auto-generated transcripts\n    --preserve-formatting   Preserve HTML formatting in text\n-h, --help              Show help message\n```\n\n## Exception Handling\n\nThe library provides detailed exceptions for different error scenarios:\n\n```dart\ntry {\n  final transcript = await api.fetch('video-id');\n} on VideoUnavailableException catch (e) {\n  print('Video not available: ${e.videoId}');\n} on TranscriptsDisabledException catch (e) {\n  print('Transcripts are disabled for this video');\n} on NoTranscriptFoundException catch (e) {\n  print('No transcript found for languages: ${e.requestedLanguages}');\n  print('Available languages: ${e.availableLanguages}');\n} on TooManyRequestsException catch (e) {\n  print('Rate limited by YouTube. Consider using a proxy.');\n} on IpBlockedException catch (e) {\n  print('IP blocked by YouTube. Use a proxy.');\n} on TranscriptException catch (e) {\n  print('General error: $e');\n}\n```\n\n## Advanced Features\n\n### InnerTube API Integration\n\nThis library uses YouTube's InnerTube API to bypass PoToken protection and access transcripts reliably. It pretends to be an Android client, which helps avoid bot detection and rate limiting.\n\n### Custom Headers and Timeout\n\n```dart\nfinal api = YouTubeTranscriptApi(\n  headers: {\n    'User-Agent': 'MyCustomAgent/1.0',\n  },\n  timeout: Duration(seconds: 60),\n);\n```\n\n## Limitations\n\n- YouTube may rate-limit or block requests from certain IP addresses. Consider using proxies if you encounter issues.\n- The library relies on YouTube's internal API, which may change without notice.\n- Some videos may not have transcripts available.\n- Private or age-restricted videos may not be accessible.\n\n## Platform Support\n\n| Platform | Status |\n|----------|--------|\n| ✅ Android | Fully supported |\n| ✅ iOS | Fully supported |\n| ✅ Web | Fully supported |\n| ✅ Windows | Fully supported |\n| ✅ macOS | Fully supported |\n| ✅ Linux | Fully supported |\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Credits\n\n- Inspired by and based on the Python [youtube-transcript-api](https://github.com/jdepoix/youtube-transcript-api) by [jdepoix](https://github.com/jdepoix)\n- Ported to Dart with InnerTube API integration for improved reliability\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a detailed changelog.\n\n## Support\n\n- 📖 Documentation: See [QUICK_START.md](QUICK_START.md)\n- 💻 Examples: Check the [example](example/) directory\n- 🐛 Issues: Report on [GitHub Issues](https://github.com/pandaxbacon/youtube-transcript-dart/issues)\n- 💬 Discussions: Join [GitHub Discussions](https://github.com/pandaxbacon/youtube-transcript-dart/discussions)\n\n---\n\n**Made with ❤️ for the Dart \u0026 Flutter community**\n\nIf you find this package useful, please consider giving it a ⭐ on [GitHub](https://github.com/pandaxbacon/youtube-transcript-dart)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandaxbacon%2Fyoutube-transcript-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpandaxbacon%2Fyoutube-transcript-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandaxbacon%2Fyoutube-transcript-dart/lists"}