Skip to main content

fetch_transcript

Function fetch_transcript 

Source
pub async fn fetch_transcript(
    video_id: &str,
    http: &HttpClient,
    config: &FetchiumConfig,
) -> FetchiumResult<EnhancedTranscript>
Expand description

Fetch enhanced transcript by racing all sources simultaneously.

Sources (all start in parallel, first non-empty result wins):

  1. Watch-page scraping — extracts pre-signed captionTracks baseUrl from HTML (same technique as youtube-transcript-api; bypasses bot detection)
  2. Innertube API POST (fallback — may fail without visitor cookies)
  3. Invidious captions API
  4. Piped captions API

Global cap: 15s — the pipeline never blocks longer regardless of source health.