crewAIInc/crewAI · error · ValueError

No transcript available for YouTube video: {video_id}

Error message

No transcript available for YouTube video: {video_id}

What it means

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...'.

Source

Thrown at lib/crewai-tools/src/crewai_tools/rag/loaders/youtube_video_loader.py:89

                content = " ".join(text_content)

                try:
                    from pytube import YouTube  # type: ignore[import-untyped]

                    yt = YouTube(video_url)
                    metadata["title"] = yt.title
                    metadata["author"] = yt.author
                    metadata["length_seconds"] = yt.length
                    metadata["description"] = (
                        yt.description[:500] if yt.description else None
                    )

                    if yt.title:
                        content = f"Title: {yt.title}\n\nAuthor: {yt.author or 'Unknown'}\n\nTranscript:\n{content}"
                except Exception:  # noqa: S110
                    pass
            else:
                raise ValueError(
                    f"No transcript available for YouTube video: {video_id}"
                )

        except Exception as e:
            raise ValueError(
                f"Unable to extract transcript from YouTube video {video_id}: {e!s}"
            ) from e

        return LoaderResult(
            content=content,
            source=video_url,
            metadata=metadata,
            doc_id=self.generate_doc_id(source_ref=video_url, content=content),
        )

    @staticmethod
    def _extract_video_id(url: str) -> str | None:
        """Extract video ID from various YouTube URL formats."""

View on GitHub (pinned to 754d7323be)

Solutions

  1. Open the video in a browser and check the CC/subtitles menu — if no captions exist, no loader setting can produce a transcript.
  2. 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).
  3. Confirm the video is public and not region-blocked from your server's location.
  4. For fresh uploads, wait for auto-captions to finish processing and retry.

Example fix

# before
result = loader.load(src)  # no captions -> ValueError

# after
try:
    result = loader.load(src)
except ValueError as e:
    if "No transcript available" in str(e):
        result = transcribe_audio_with_whisper(video_id)  # fallback path
    else:
        raise
Defensive patterns

Strategy: fallback

Validate before calling

from youtube_transcript_api import YouTubeTranscriptApi

def has_transcript(video_id: str) -> bool:
    try:
        api = YouTubeTranscriptApi()
        return any(t.is_generated or not t.is_generated for t in api.list(video_id))
    except Exception:
        return False

Try / catch

try:
    result = yt_video_loader.load(src)
except ValueError as e:
    if "No transcript available" in str(e):
        result = whisper_fallback(video_id)  # audio transcription path
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/64242d360b0353b4. Report an issue: GitHub.