Skip to content

Chrome extension to extract and download transcripts from YouTube Shorts using modern Innertube API (2025 compatible)

mvijay24/youtube-shorts-transcript-downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Shorts Transcript Downloader

A Chrome extension that extracts and downloads transcripts from YouTube Shorts using the modern Innertube API.

Features

  • YouTube Shorts Support - Works specifically with YouTube Shorts
  • Innertube API - Uses YouTube's internal API (2025 compatible)
  • Auto-Generated Transcripts - Extracts ASR (auto speech recognition) captions
  • Detailed Logging - Configurable logging with DEBUG/INFO/WARNING/ERROR levels
  • Error Recovery - Retry logic with exponential backoff
  • Clean Downloads - Sanitized filenames with metadata

Installation

  1. Download or clone this repository
  2. Open Chrome and go to chrome://extensions/
  3. Enable "Developer mode"
  4. Click "Load unpacked" and select this folder
  5. Extension is ready to use!

Usage

  1. Navigate to any YouTube Shorts video
  2. Click the extension icon in the toolbar
  3. Click "Download" button
  4. Transcript file will be downloaded automatically
  5. Debug logs are also downloaded (if enabled in config)

How It Works

Technical Implementation (2025 Method)

  1. Video ID Extraction: Extracts video ID from YouTube Shorts URLs
  2. API Key Extraction: Finds INNERTUBE_API_KEY from page HTML using regex
  3. Innertube API Request: Makes POST request to youtubei/v1/player with Android client context
  4. Caption Track Selection: Finds ASR (auto-generated) English captions
  5. XML Parsing: Downloads and parses transcript XML with fallback methods
  6. File Generation: Creates formatted transcript with metadata

Key Components

  • Centralized Configuration - All settings in CONFIG object
  • Modular Architecture - Separate classes for extraction, logging, downloads
  • Robust Error Handling - Comprehensive logging and retry mechanisms
  • Multiple Format Support - Handles different XML node types (text, p, s)

Configuration

Edit the CONFIG object in content.js:

const CONFIG = {
  LOGGING: {
    ENABLED: true,
    LEVEL: 'DEBUG', // DEBUG, INFO, WARNING, ERROR
    CONSOLE_OUTPUT: true,
    FILE_OUTPUT: true
  },
  API: {
    CLIENT_NAME: 'ANDROID',
    CLIENT_VERSION: '20.10.38',
    RETRY_COUNT: 3
  },
  DOWNLOAD: {
    FILE_PREFIX: 'yt-transcript-',
    INCLUDE_TIMESTAMP: true,
    SANITIZE_FILENAME: true
  }
};

Files

  • manifest.json - Extension manifest (v3)
  • content.js - Main extraction logic with Innertube API
  • popup.html - Extension popup interface
  • popup.js - Popup button handler
  • README.md - This documentation

Why Innertube API?

Many YouTube transcript libraries stopped working in 2024-2025 due to YouTube changes. The Innertube API is YouTube's internal API used by their own clients (web, mobile, embedded), making it the most reliable method.

Android client impersonation provides the most stable access to caption data.

Troubleshooting

  • Check browser console for detailed logs
  • Ensure you're on a YouTube Shorts page
  • Try refreshing the page if API key extraction fails
  • Check downloaded log files for debugging information

License

MIT License - Feel free to use and modify!

Version

v2.0 - Complete rewrite with Innertube API and modern architecture

About

Chrome extension to extract and download transcripts from YouTube Shorts using modern Innertube API (2025 compatible)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •