Skip to content

Releases: rajat-mehra05/youtube-transcript-api-js

v3.0.0

06 Mar 07:19
3a626f7

Choose a tag to compare

Breaking Changes

  • TranscriptParser.parse() now throws TranscriptParseError for non-transcript input instead of silently returning []
  • CouldNotRetrieveTranscript.message now returns the full error message (previously empty; only toString() worked)
  • Replaced xml2js with fast-xml-parser — removes xml2js and @types/xml2js dependencies
  • Retry logic uses exponential backoff with jitter instead of immediate recursive retry. Set baseDelayMs: 0 to restore previous behavior
  • EnhancedYouTubeTranscriptApi.fetch() return type narrowed from Promise<any> to Promise<FetchedTranscript | string>

Added

  • Cookie authentication: Load cookies from Netscape .txt or JSON files for age-restricted videos via cookiePath option or --cookies CLI flag
  • Retry with exponential backoff: Configurable RetryConfig with maxRetries, baseDelayMs, maxDelayMs, jitterFactor
  • YouTubeTranscriptApiOptions: Options object as 3rd constructor parameter (retryConfig, cookiePath)
  • CLI flags: --cookies, --verbose, --save, --batch-file, --fail-fast
  • Exported missing types: InvalidProxyUrl, TranscriptParseError, RateLimitExceeded, NetworkError, TimeoutError, ConnectionError, RetryConfig, DEFAULT_RETRY_CONFIG, loadCookiesFromFile, ParsedCookie, FormatterOptions, CliOptions

Fixed

  • Removed stray console.log debug output from CLI
  • CLI process.argv fallback no longer captures option values as video IDs
  • Consent cookie handling now appends to existing cookies instead of overwriting
  • AgeRestricted error message now includes cookie auth instructions

v2.2.0

21 Feb 12:15
2982646

Choose a tag to compare

New Features

  • VideoMetadata threading: Video metadata (videoDetails) from the Innertube API response is now threaded through TranscriptList, Transcript, and FetchedTranscript via an optional metadata field.
  • getVideoMetadata() returns real data: EnhancedYouTubeTranscriptApi.getVideoMetadata() returns actual video metadata from the Innertube API instead of hardcoded stub values.
  • TimestampedTextFormatter: New LLM-friendly formatter producing [M:SS] text output with optional groupBySeconds bucketing. Use via FormatterLoader.load('timestamped').
  • VideoMetadataResult export: Explicit interface for the return type of getVideoMetadata().

Bug Fixes

  • Proxy config wired to base API: EnhancedYouTubeTranscriptApi proxy options are now correctly passed to the underlying YouTubeTranscriptApi via EnhancedProxyConfig. Previously silently ignored.
  • ESM-compatible imports: Replaced require('http') / require('https') with ESM imports to prevent bundler breakage.
  • getVideoMetadata() throws YouTubeTranscriptApiException instead of bare Error for correct instanceof handling.

v2.1.0

24 Jan 13:27
1b3fd52

Choose a tag to compare

Minor Changes

  • 63d05cf: update package-lock.json

v2.0.2

24 Jan 13:09
ba99211

Choose a tag to compare

Patch Changes

  • 1851e58: update workflow and bump version

v1.2.0

24 Jan 09:11
23ec906

Choose a tag to compare

What's Changed

  • chore: update pkg version to 1.0.3 and add changesets config by @rajat-mehra05 in #5
  • Version Packages by @github-actions[bot] in #6
  • Version Packages by @github-actions[bot] in #7

New Contributors

  • @github-actions[bot] made their first contribution in #6

Full Changelog: v1.0.2...v1.2.0