YouTube Transcription icon

YouTube Transcription

Get transcription/subtitles from YouTube videos

YouTube Transcription

AI-generated

Overview

The YouTube Transcription node extracts subtitles or transcriptions from YouTube videos based on a provided video ID or URL. It fetches the available captions for the video and returns them in various formats, including structured JSON with timestamps, plain text, or SRT subtitle format.

This node is useful when you want to:

  • Automatically generate transcripts of YouTube videos for accessibility or content analysis.
  • Extract subtitles for translation or further processing.
  • Integrate YouTube video captions into workflows without manual downloading.

Practical examples:

  • A content creator automates generating blog posts by extracting video transcripts.
  • A language learning app pulls subtitles from educational videos to create study materials.
  • A media monitoring tool collects spoken content from videos for keyword analysis.

Properties

Name Meaning
Video ID or URL The YouTube video identifier or full URL to extract transcription from. Examples: dQw4w9WgXcQ or https://www.youtube.com/watch?v=dQw4w9WgXcQ. This is required.
Options Collection of optional settings:
- Continue On Fail Whether to continue workflow execution if transcription retrieval fails (true or false). Default is false.
- Language Preferred language code (e.g., en, vi, fr) for transcription. Leave empty to auto-detect language.
- Format Output format of the transcription. Options:
- Structured JSON: Returns detailed JSON with timestamps and metadata.
- Plain Text: Returns only the transcript text without timestamps.
- SRT Format: Returns subtitles in standard SRT format suitable for video players.

Output

The node outputs an array of items where each item contains a json field with transcription data structured according to the selected format:

  • Structured JSON (default):

    {
      "videoId": "string",
      "title": "string",
      "url": "string",
      "transcription": [
        {
          "text": "string",
          "offset": number,       // start time in seconds
          "duration": number,     // duration in seconds
          "language": "string"
        },
        ...
      ],
      "metadata": {
        "totalDuration": number,   // total length of transcription in seconds
        "segmentCount": number,    // number of transcription segments
        "language": "string",      // detected or specified language code
        "videoTitle": "string",
        "videoDuration": number,   // video length in seconds
        "channelName": "string"
      }
    }
    
  • Plain Text:

    {
      "videoId": "string",
      "title": "string",
      "text": "string",           // concatenated transcript text without timestamps
      "language": "string"
    }
    
  • SRT Format:

    {
      "videoId": "string",
      "title": "string",
      "srt": "string",            // subtitles in SRT format
      "language": "string"
    }
    

No binary data output is produced by this node.

Dependencies

  • Uses the ytdl-core library to fetch YouTube video information and captions.
  • Uses axios to download caption files from YouTube.
  • No external API keys or credentials are required.
  • Requires internet access to reach YouTube services.

Troubleshooting

  • Common issues:

    • No captions available: Some videos do not have subtitles or captions enabled; the node will throw an error indicating no captions found.
    • Age-restricted or private videos: Videos requiring sign-in or restricted content will cause errors like "This video requires sign-in or is age-restricted".
    • Video unavailable: If the video is deleted, private, or removed, errors such as "Video is unavailable or private" or "This video is no longer available" may occur.
    • Invalid video ID or URL: If the input does not match expected YouTube video ID patterns, transcription will fail.
  • Error handling:

    • If "Continue On Fail" option is enabled, the node will output an error object per failed item instead of stopping the workflow.
    • Otherwise, it throws an error halting execution with messages describing the failure reason.

Links and References

Discussion