{"record":{"id":"64242d360b0353b4","repo":"crewAIInc/crewAI","slug":"no-transcript-available-for-youtube-video-video","errorCode":null,"errorMessage":"No transcript available for YouTube video: {video_id}","messagePattern":"No transcript available for YouTube video: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/rag/loaders/youtube_video_loader.py","lineNumber":89,"sourceCode":"                content = \" \".join(text_content)\n\n                try:\n                    from pytube import YouTube  # type: ignore[import-untyped]\n\n                    yt = YouTube(video_url)\n                    metadata[\"title\"] = yt.title\n                    metadata[\"author\"] = yt.author\n                    metadata[\"length_seconds\"] = yt.length\n                    metadata[\"description\"] = (\n                        yt.description[:500] if yt.description else None\n                    )\n\n                    if yt.title:\n                        content = f\"Title: {yt.title}\\n\\nAuthor: {yt.author or 'Unknown'}\\n\\nTranscript:\\n{content}\"\n                except Exception:  # noqa: S110\n                    pass\n            else:\n                raise ValueError(\n                    f\"No transcript available for YouTube video: {video_id}\"\n                )\n\n        except Exception as e:\n            raise ValueError(\n                f\"Unable to extract transcript from YouTube video {video_id}: {e!s}\"\n            ) from e\n\n        return LoaderResult(\n            content=content,\n            source=video_url,\n            metadata=metadata,\n            doc_id=self.generate_doc_id(source_ref=video_url, content=content),\n        )\n\n    @staticmethod\n    def _extract_video_id(url: str) -> str | None:\n        \"\"\"Extract video ID from various YouTube URL formats.\"\"\"","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/rag/loaders/youtube_video_loader.py#L71-L107","documentation":"ValueError raised when youtube-transcript-api returns no transcripts for the video: the transcript list exists but is empty or has no retrievable entry. Videos with subtitles disabled, private/unavailable videos, or region-blocked content typically land here. Caveat: this raise happens INSIDE the outer try, so it is itself re-wrapped by error 255 — the message you see at top level is usually 'Unable to extract transcript...: No transcript available...'.","triggerScenarios":"Calling the video loader on a video whose captions are disabled by the uploader, a video with auto-captions still processing, an unlisted/private video, or one whose transcripts are geo-restricted in your region. Passing a syntactically valid but nonexistent 11-char ID also reaches here via the transcript API returning nothing.","commonSituations":"Document-QA pipelines pointed at arbitrary user-supplied video URLs where caption availability is uncontrolled; freshly uploaded videos before captions generate; music videos and auto-generated content that often skip captions.","solutions":["Open the video in a browser and check the CC/subtitles menu — if no captions exist, no loader setting can produce a transcript.","Catch the outer ValueError and check whether 'No transcript available' appears in the message, then skip or substitute an alternative source (audio transcription via Whisper).","Confirm the video is public and not region-blocked from your server's location.","For fresh uploads, wait for auto-captions to finish processing and retry."],"exampleFix":"# before\nresult = loader.load(src)  # no captions -> ValueError\n\n# after\ntry:\n    result = loader.load(src)\nexcept ValueError as e:\n    if \"No transcript available\" in str(e):\n        result = transcribe_audio_with_whisper(video_id)  # fallback path\n    else:\n        raise","handlingStrategy":"fallback","validationCode":"from youtube_transcript_api import YouTubeTranscriptApi\n\ndef has_transcript(video_id: str) -> bool:\n    try:\n        api = YouTubeTranscriptApi()\n        return any(t.is_generated or not t.is_generated for t in api.list(video_id))\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    result = yt_video_loader.load(src)\nexcept ValueError as e:\n    if \"No transcript available\" in str(e):\n        result = whisper_fallback(video_id)  # audio transcription path\n    else:\n        raise","preventionTips":["Treat caption availability as uncontrolled input; design a fallback (audio transcription) for videos without captions.","Pre-check transcript availability with youtube-transcript-api before invoking the loader to skip cleanly.","Do not retry — missing captions are permanent for that video."],"tags":["youtube","transcript","captions","content-missing"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}