Registry / http-networking / yt-dlp-ejs

yt-dlp-ejs

JSON →
library0.8.0pypypi✓ verified 22d ago

yt-dlp-ejs is a specialized Python library that provides external JavaScript execution capabilities for yt-dlp, the popular video downloader. It solves YouTube's signature and n-parameter challenges by bundling JavaScript solvers that work across multiple runtimes such as Deno, Bun, Node.js, and QuickJS. Currently at version 0.8.0, it maintains a frequent release cadence to adapt to YouTube's player code changes.

pip install yt-dlp-ejs
INSTALL
IMPORT
SIG · YT-DLP-EJS
Y
yt-dlp-ejs
http-networkingpythonv0.8.0
Install
3.1s avg
Import
54ms
Disk
60MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 3.2s
py 3.11
✓ —
✓ 3.15s
py 3.12
✓ —
✓ 2.95s
py 3.13
✓ —
✓ 2.95s
py 3.9
1/2 runs
1/2 runs
60MB installed
● package 60MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

yt_dlp_ejs.yt.solver
import yt_dlp_ejs.yt.solver
Typically, end-users do not directly import this library; yt-dlp uses it automatically. This import is for advanced use cases like custom video extractors or direct interaction with solver APIs.

This quickstart demonstrates how yt-dlp-ejs is used implicitly by yt-dlp to decrypt YouTube video URLs. No explicit Python code is usually needed to interact with yt-dlp-ejs directly when using yt-dlp. It also includes a check for direct import for debugging purposes.

import os from yt_dlp import YoutubeDL # yt-dlp-ejs is automatically detected by yt-dlp if installed. # Ensure a JS runtime (Deno, Node.js, Bun) is available in your PATH # or specified via yt-dlp options (e.g., --js-runtimes deno:/path/to/deno) # Example: Download a YouTube video that requires signature/n-parameter decryption # For this to work, yt-dlp-ejs and a JS runtime must be correctly set up. url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' # Example URL with YoutubeDL({'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best'}) as ydl: info = ydl.extract_info(url, download=False) print(f"Title: {info.get('title')}") print(f"Uploader: {info.get('uploader')}") print(f"Duration: {info.get('duration_string')}") print("yt-dlp-ejs (and a JS runtime) was implicitly used for decryption.") # To explicitly verify the presence of EJS solvers (for advanced debugging) try: from yt_dlp_ejs.yt.solver import core, lib print("yt_dlp_ejs solvers (core, lib) are importable.") # Example of accessing a solver, though not typically done by end-users: # core_js = core() # print(f"Core solver JS size: {len(core_js)} bytes") except ImportError: print("yt_dlp_ejs solvers are not directly importable or installed.")
Debug
Known issues
breakingyt-dlp is often pinned to a specific compatible version of yt-dlp-ejs. Using mismatched versions can lead to 'No suitable player found' or 'Signature/n-parameter decryption failed' errors, especially for YouTube videos.
fix
Always install/update yt-dlp-ejs concurrently with yt-dlp, preferably by installing `yt-dlp[default]` or ensuring versions match the `yt-dlp`'s `pyproject.toml` definition. `pip install -U yt-dlp yt-dlp-ejs` is recommended.
affects: All versions
gotchayt-dlp-ejs *requires* an external JavaScript runtime (e.g., Deno, Node.js, Bun, or QuickJS) to be installed on your system. Without one, yt-dlp-ejs cannot function, and YouTube support in yt-dlp will be limited or broken.
fix
Install a supported JavaScript runtime (Deno is highly recommended) and ensure it's accessible in your system's PATH. You can also specify the runtime path using yt-dlp's `--js-runtimes` option (e.g., `--js-runtimes deno:/path/to/deno`).
affects: All versions
gotchaYouTube frequently updates its player code, which can break yt-dlp-ejs's decryption logic. This necessitates frequent updates to yt-dlp-ejs.
fix
Regularly update `yt-dlp` and `yt-dlp-ejs` to their latest versions to ensure compatibility with YouTube's most recent player changes. `pip install -U yt-dlp yt-dlp-ejs`.
affects: All versions
gotchaIf building from source or performing advanced integrations, be aware that internal changes (like exposing `window` as `self` in 0.8.0 or making `window` a local in 0.2.0) might affect custom JavaScript code relying on these globals.
fix
Review the `yt-dlp-ejs` changelog and ensure your custom JavaScript or integration code is compatible with the changes in global scope handling if directly calling the internal solver scripts.
affects: 0.2.0+, 0.8.0+
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'yt_dlp_ejs'
The yt-dlp-ejs library is not installed in your current Python environment.
fix
Install the library using pip: `pip install yt-dlp-ejs`
yt_dlp.utils.ExtractorError: Failed to spawn javascript runtime
One of the required JavaScript runtimes (Deno, Bun, Node.js, or QuickJS) is not installed on your system, or its executable is not found in your system's PATH environment variable.
fix
Install a supported JavaScript runtime (e.g., Node.js, Deno) and ensure its executable is accessible in your system's PATH. For example, for Node.js: `npm install -g n` or for Deno: `brew install deno`.
yt_dlp.utils.ExtractorError: Signature extraction failed
Despite using yt-dlp-ejs, YouTube's player signature algorithm may have changed recently, rendering the current JavaScript solvers temporarily ineffective, or there's an issue with the chosen JavaScript runtime's execution.
fix
Update `yt-dlp-ejs` (`pip install --upgrade yt-dlp-ejs`) and `yt-dlp` (`pip install --upgrade yt-dlp`) to their latest versions. If the problem persists, try configuring a different JavaScript runtime, or report the issue to the `yt-dlp-ejs` project.
Upgrade
Version history
0.8.0latest on PyPI · released Mar 17, 2026
Audit
Dependencies
yt-dlprequiredThis library is a companion package for yt-dlp, providing essential JavaScript challenge-solving capabilities for YouTube. yt-dlp will automatically detect and use it.
Deno / Node.js / Bun / QuickJSoptionalAn external JavaScript runtime (Deno is recommended) must be installed on the system for yt-dlp-ejs to execute the solver scripts. Not a Python package dependency.
Agent activity
102 hits · last 30 days
node
94
Perplexity
1
Resources
yt-dlp-ejs — pip install yt-dlp-ejs · libregistry