{"record":{"id":"d1823d92edfbbcc0","repo":"unslothai/unsloth","slug":"this-video-has-no-captions","errorCode":null,"errorMessage":"This video has no captions.","messagePattern":"This video has no captions\\.","errorType":"exception","errorClass":"TranscriptUnavailable","httpStatus":null,"severity":"warning","filePath":"studio/backend/core/youtube_transcript.py","lineNumber":124,"sourceCode":"    Within a language a human-written track wins over an auto-generated one. With no\n    match the track YouTube pairs with the video's default audio track is used.\n    \"\"\"\n    if not _VIDEO_ID_RE.fullmatch(video_id):\n        raise TranscriptUnavailable(\"That is not a YouTube video link.\")\n\n    async with httpx.AsyncClient(timeout = _TIMEOUT, follow_redirects = True) as client:\n        player = await _fetch_player(client, video_id)\n        status = (player.get(\"playabilityStatus\") or {}).get(\"status\")\n        if status not in (None, \"OK\"):\n            raise TranscriptUnavailable(\n                (player.get(\"playabilityStatus\") or {}).get(\"reason\")\n                or \"YouTube will not play this video.\"\n            )\n\n        tracklist = (player.get(\"captions\") or {}).get(\"playerCaptionsTracklistRenderer\") or {}\n        tracks = [t for t in (tracklist.get(\"captionTracks\") or []) if t.get(\"baseUrl\")]\n        if not tracks:\n            raise TranscriptUnavailable(\"This video has no captions.\")\n\n        track = _select_track(tracks, tracklist, languages)\n        text = await _fetch_track_text(client, str(track[\"baseUrl\"]))\n\n    if not text:\n        raise TranscriptUnavailable(\"This video's captions are empty.\")\n    text, truncated = _truncate_transcript(text)\n\n    details = player.get(\"videoDetails\") or {}\n    return Transcript(\n        video_id = video_id,\n        title = str(details.get(\"title\") or \"\"),\n        author = str(details.get(\"author\") or \"\"),\n        length_seconds = _as_int(details.get(\"lengthSeconds\")),\n        language = _track_label(track),\n        language_code = str(track.get(\"languageCode\") or \"\"),\n        is_generated = track.get(\"kind\") == \"asr\",\n        text = text,","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/youtube_transcript.py#L106-L142","documentation":"TranscriptUnavailable raised when the player response contains a captions.playerCaptionsTracklistRenderer with no captionTracks entries that have a baseUrl. The video exists and plays, but YouTube exposes no caption tracks for it — no human subtitles and no auto-generated (ASR) track.","triggerScenarios":"Videos where the uploader disabled subtitles and auto-captions have not been generated (or were turned off); music-heavy or non-speech videos where ASR produced nothing; tracks present but all missing baseUrl (filtered out).","commonSituations":"Auto-transcription features pointed at music videos, gameplay with no speech, or freshly uploaded videos where ASR is still processing; rare player-response shape changes dropping captionTracks.","solutions":["Confirm the video shows a CC button on YouTube's watch page; if not, no transcript exists — skip it.","If the video is new, retry later once auto-captions may have been generated.","Use an alternative transcript source (whisper-based local transcription) when YouTube has none."],"exampleFix":"# before\ntranscript = await fetch_transcript(video_id)\n\n# after\ntry:\n    transcript = await fetch_transcript(video_id)\nexcept TranscriptUnavailable as exc:\n    transcript = await transcribe_locally(video_id)  # fallback, e.g. whisper","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    transcript = await fetch_transcript(video_id)\nexcept TranscriptUnavailable as e:\n    if \"no captions\" in str(e):\n        transcript = await transcribe_audio_locally(video_id)  # e.g. whisper\n    else:\n        raise","preventionTips":["Pre-filter with the oembed/has_cc signal if available, or accept that some videos have no captions.","Build UIs to surface 'no captions' as an expected outcome, not a crash.","Retry later for fresh uploads where ASR may still be generating."],"tags":["youtube","transcript","no-captions","data-availability"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}