# YouTube Downloader (`serpdownloaders/youtube-downloader`) Actor

Browser extension for detecting YouTube watch-page, Shorts, and embedded-player streams, then assembling offline MP4 or WebM downloads locally.

- **URL**: https://apify.com/serpdownloaders/youtube-downloader.md
- **Developed by:** [SERP Downloaders](https://apify.com/serpdownloaders) (community)
- **Categories:** Videos, Automation, Social media
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## YouTube Downloader (Browser Extension)

> Download supported YouTube videos as MP4 or WebM files from watch pages, Shorts, and embedded players.

YouTube Downloader is a browser extension built for users who need a cleaner way to save supported YouTube videos for offline access. It is designed for browser playback flows across watch pages, Shorts, and embedded players, and it helps you export usable files without relying on manual stream handling.

- Save supported YouTube videos from watch pages, Shorts, and embeds
- Export MP4 or WebM output depending on the source workflow
- Keep offline copies for research, editing, and review
- Use a browser-native download flow instead of manual extraction
- Preserve a cleaner workflow for long-form and short-form content

### Links

- :rocket: Get it here: [YouTube Downloader](https://serp.ly/youtube-downloader)
- :new: Latest release: [GitHub Releases](https://github.com/serpapps/youtube-downloader/releases/latest)
- :question: Help center: [SERP Help](https://help.serp.co/en/)
- :beetle: Report bugs: [GitHub Issues](https://github.com/serpapps/youtube-downloader/issues)
- :bulb: Request features: [Feature Requests](https://github.com/serpapps/youtube-downloader/issues)

### Preview

![YouTube Downloader workflow preview](assets/workflow-preview.webp)

### Table of Contents

- [Why YouTube Downloader](#why-youtube-downloader)
- [Features](#features)
- [How It Works](#how-it-works)
- [Step-by-Step Tutorial: How to Download Videos from YouTube](#step-by-step-tutorial-how-to-download-videos-from-youtube)
- [Supported Formats](#supported-formats)
- [Who It's For](#who-its-for)
- [Common Use Cases](#common-use-cases)
- [Troubleshooting](#troubleshooting)
- [Trial & Access](#trial--access)
- [Installation Instructions](#installation-instructions)
- [FAQ](#faq)
- [License](#license)
- [Notes](#notes)
- [About YouTube](#about-youtube)

### Why YouTube Downloader

YouTube uses adaptive streaming and multiple playback contexts, so the actual media source is not exposed as one obvious file. Watch pages, Shorts, and embedded players can all behave differently. That makes generic downloader behavior inconsistent and often harder than users expect.

YouTube Downloader is built to simplify that browser workflow. Open the page, let the extension detect the supported media source, choose the format or quality you want when options are available, and export a file you can keep offline.

### Features

- Detects supported YouTube media from watch pages, Shorts, and embeds
- Multi-client InnerTube API extraction covering all available qualities from 144p to 4K
- In-page download button built into the YouTube video player
- Automatic HLS-to-MP4 conversion and SABR/UMP streaming support as fallbacks
- Handles browser playback workflows more cleanly than manual extraction
- Exports usable MP4 or WebM output depending on the source
- Download queue with up to 3 concurrent downloads
- Detects YouTube embeds on third-party websites
- SPA-aware detection that works with YouTube navigation without page reloads
- Works on Chrome, Edge, Brave, Opera, Firefox, Whale, and Yandex

### How It Works

1. Install the extension from the latest release.
2. Open a YouTube video, Short, or embedded player and start playback.
3. Let the extension detect the active media source.
4. Open the popup or use the in-page download button on the player.
5. Review the available formats and quality options.
6. Select the quality you want from the available resolutions.
7. Start the download and save the file locally.

### Step-by-Step Tutorial: How to Download Videos from YouTube

1. Install YouTube Downloader in your browser.
2. Open the YouTube watch page, Short, or embedded player you want to save.
3. Start playback so the browser loads the active media source.
4. Click the in-page download button on the player, or open the extension popup.
5. Review the detected video options and available qualities.
6. Choose the format or quality you want if more than one option is listed.
7. Start the download and wait for the export to finish.
8. Open the saved file from your Downloads folder.
9. For advanced use, copy yt-dlp commands from the popup for Mac or Windows.

### Supported Formats

- Input: supported YouTube browser playback sources
- Output: MP4 or WebM, depending on the source workflow

Saved files typically use MP4 so they are easier to replay on standard media players, move between devices, or archive locally. When separate video and audio streams are downloaded, they are merged automatically.

### Who It's For

- Researchers saving reference videos for offline review
- Creators keeping working copies of their own content
- Students archiving educational or tutorial content
- Users who want a browser-based workflow for supported YouTube pages
- People who need offline access to videos they can already watch in the browser

### Common Use Cases

- Save a YouTube watch-page video for later
- Download Shorts for offline reference
- Export embedded-player content from supported sites
- Download YouTube videos embedded on third-party websites
- Keep local copies for review, research, or editing

### Troubleshooting

**The extension does not detect the video**  
Start playback first and wait for the page to initialize the active source.

**The page is a Short or embed**  
Open the popup again after playback starts so the extension can rescan the active page state.

**Only one format appears**
That means the current playback flow is exposing one usable source to the extension.

**The download failed partway through**
Check your connection and refresh the page before starting again. Try a different quality if one format fails.

**The page is age-restricted or region-locked**
The extension only works on media you can already open and play in your active browser session.

### Trial & Access

- Includes **3 free downloads** so you can test the workflow first
- Email sign-in uses secure one-time password verification
- No credit card required for the trial
- Unlimited downloads are available with a paid license

Start here: [https://serp.ly/youtube-downloader](https://serp.ly/youtube-downloader)

### Installation Instructions

1. Open the latest release page: [GitHub Releases](https://github.com/serpapps/youtube-downloader/releases/latest)
2. Download the correct build for your browser.
3. Install the extension.
4. Open a supported YouTube page and start playback.
5. Use the popup to detect and download the media.

### FAQ

**Can it work on Shorts and embeds?**  
Yes. It supports supported Shorts and embedded-player workflows in addition to watch pages.

**Does it always export MP4?**  
Not always. Output depends on the active source workflow and available media format.

**Do I need extra software?**
No. The workflow runs entirely inside the browser extension.

**Can I download YouTube videos embedded on other websites?**
Yes. The extension detects YouTube iframes and links on any website and shows download buttons next to them.

**What is the yt-dlp command feature?**
For advanced users, the popup includes buttons to copy yt-dlp commands for Mac and Windows, in case you prefer to download via the command line.

**Is my data safe?**
Yes. All video processing happens locally in your browser. Authentication uses secure OTP with no passwords stored.

### License

This repository is distributed under the proprietary SERP Apps license in the [LICENSE](LICENSE) file. Review that file before copying, modifying, or redistributing any part of this project.

### Notes

- Only download content you own or have explicit permission to save
- An internet connection is required for downloads
- Quality depends on the original upload resolution
- YouTube API changes may temporarily affect functionality
- Must press play before detection can begin

### About YouTube

YouTube is a large video platform with multiple playback contexts and adaptive streaming workflows. YouTube Downloader is built to make supported browser downloads easier for users who already have access to that media in the browser.

# Actor input Schema

## `listingNotice` (type: `string`):

Optional informational field only. This actor currently serves as the public listing surface for the browser extension and does not yet expose a finalized runtime API contract.

## Actor input object example

```json
{
  "listingNotice": "No runtime input is required yet. See the README and product page for the current extension workflow."
}
````

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("serpdownloaders/youtube-downloader").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("serpdownloaders/youtube-downloader").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call serpdownloaders/youtube-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=serpdownloaders/youtube-downloader",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Downloader",
        "description": "Browser extension for detecting YouTube watch-page, Shorts, and embedded-player streams, then assembling offline MP4 or WebM downloads locally.",
        "version": "0.0",
        "x-build-id": "xzjQx7itIOhvzViwC"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/serpdownloaders~youtube-downloader/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-serpdownloaders-youtube-downloader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/serpdownloaders~youtube-downloader/runs": {
            "post": {
                "operationId": "runs-sync-serpdownloaders-youtube-downloader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/serpdownloaders~youtube-downloader/run-sync": {
            "post": {
                "operationId": "run-sync-serpdownloaders-youtube-downloader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "listingNotice": {
                        "title": "Listing notice",
                        "type": "string",
                        "description": "Optional informational field only. This actor currently serves as the public listing surface for the browser extension and does not yet expose a finalized runtime API contract.",
                        "default": "No runtime input is required yet. See the README and product page for the current extension workflow."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
