ytdlp-ejs
YouTube player signature solver implemented in Rust, using SWC for JavaScript parsing and multiple runtime options for execution.
A Rust port of yt-dlp/ejs.
📖 Improving yt-dlp-ejs with Rust: Smaller and Faster
Features
- Parse YouTube player JavaScript code
- Extract and execute signature (
sig) decryption functions - Extract and execute throttle parameter (
n) decryption functions - Multiple JavaScript runtime support: QuickJS, Boa, Node, Deno, Bun
- Cross-platform support (Windows, Linux, macOS)
- Standalone binary under 5MB (with SWC + QuickJS)
Installation
From Source
# Default build (QuickJS + Boa + External runtimes)
# QuickJS only (smallest binary)
# Boa only
Binary output: target/release/ejs
As a Library
[]
= { = "https://github.com/ahaoboy/ytdlp-ejs", = ["qjs"] }
Usage
Command Line
# Basic usage
# Specify runtime
Output (JSON):
As a Library
use ;
let input = Player ;
let output = process_input_with_runtime;
Runtime Options
| Runtime | Feature | Binary Size | External Dependency |
|---|---|---|---|
| QuickJS | qjs |
~5MB | None (embedded) |
| Boa | boa |
~8MB | None (embedded) |
| Node | external |
- | Requires Node.js |
| Deno | external |
- | Requires Deno |
| Bun | external |
- | Requires Bun |
Benchmark (Ubuntu)
| Runtime | Pass | Fail | Total | Time |
|---|---|---|---|---|
| qjs | 316 | 0 | 316 | 80.101s |
| node | 316 | 0 | 316 | 87.947s |
| bun | 316 | 0 | 316 | 147.197s |
| boa | 316 | 0 | 316 | 178.557s |
| deno | 316 | 0 | 316 | 238.250s |
Latest results: bench.yml