youtube_dlp

module
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: Apache-2.0

README

ytdlp-go

A native, Python-free media engine for command-line and Go applications.

Go 1.25.12 Python-free Apache License 2.0

Installation · VidStow · CLI · Go API · Documentation · Contributing


ytdlp-go is an independent Go implementation informed by the observable behavior of yt-dlp. It provides one native media engine through a CLI, an embeddable Go API, and explicit provider compositions. The separate VidStow project provides a focused desktop experience powered by this engine.

Python is not used as a runtime, build, test, plugin, fallback, or JavaScript execution dependency. Unsupported behavior fails explicitly instead of silently invoking another implementation.

[!CAUTION] This is alpha software, not yet a drop-in replacement for yt-dlp. There are no endorsed public binary releases or installers. Supported behavior is bounded by checked-in evidence, and the native extractor catalog is much smaller than yt-dlp's. Review Project status and Supported sites before relying on a workflow.

This project is not affiliated with, endorsed by, or sponsored by yt-dlp, GitHub, Google/YouTube, or any supported service. Product and service names identify compatibility targets only.

Choose an interface

Interface Maturity Best for Start here
VidStow Beta A focused graphical workflow for public YouTube videos, Shorts, and playlists VidStow repository
ytdlp-go CLI Alpha Terminal use, scripting, and advanced controls CLI guide
pkg/ytdlp v1alpha1 Embedding the engine in another Go application Go API guide

VidStow currently accepts public, on-demand YouTube video, Short, and playlist URLs. It is versioned and released independently. The CLI and Go API expose a broader evidence-backed feature set.

Why ytdlp-go?

Principle What it provides
Native deployment Go programs and downstream applications without a Python environment
Explicit compatibility Claims linked to fixtures, tests, provenance, and known deviations
Safe composition Bounded resources, cancellation, categorized errors, and confined output
Auditable boundaries Visible interfaces for JavaScript, credentials, FFmpeg, plugins, and updates
No hidden fallback Unsupported behavior is reported instead of delegated to Python

Quick start

Go 1.25.12 or newer is required.

Build the CLI from source

The following commands use a Unix-like shell. Windows source-build commands are documented under Installation.

git clone https://github.com/tejasa97/youtube_dlp.git
cd youtube_dlp
mkdir -p bin

CGO_ENABLED=0 go build -trimpath -o bin/ytdlp-go ./cmd/ytdlp-go
CGO_ENABLED=0 go build -trimpath -o bin/ytdlp-js-helper ./cmd/ytdlp-js-helper

Keep ytdlp-js-helper beside the main executable, then verify both programs:

./bin/ytdlp-go --version
./bin/ytdlp-js-helper --version
./bin/ytdlp-go --help

Download a supported URL:

./bin/ytdlp-go URL

Choose and merge adaptive video and audio:

./bin/ytdlp-go -f "bestvideo+bestaudio/best" URL

Extract MP3 audio with FFmpeg:

./bin/ytdlp-go -x --audio-format mp3 URL

Inspect metadata without downloading media:

./bin/ytdlp-go --skip-download --print-json URL

See CLI usage for playlists, subtitles, output paths, cookies, SponsorBlock, routing, automation, and transfer controls.

Use the focused desktop application

VidStow is the independently versioned Wails/Svelte desktop application built on root engine plus providers/youtube. Its repository contains the current source-build, development, packaging, and product-scope documentation.

Embed the Go API

pkg/ytdlp exposes context-aware requests, events, categorized errors, playlists, metadata, and produced artifacts. Add the canonical package with:

go get github.com/tejasa97/youtube_dlp/pkg/ytdlp

The API remains pre-release; review upgrades and follow the embedding guide.

Project status

Area Evidence-backed scope today
Runtime Native Go programs; no Python interpreter or fallback
Downstream VidStow provides a separately versioned, focused YouTube desktop workflow
Extractors Representative simple, shared-backend, playlist, live, authenticated, regional, manifest, and JavaScript-heavy families
Media Direct HTTP(S), HLS, DASH, and ISM/Smooth Streaming
Playlists Lazy sequences, bounded continuations, item/range selection, reverse, and flat modes
Formats Bounded selection, sorting, filtering, fallbacks, merges, and multi-output plans
Post-processing Typed FFmpeg/FFprobe operations for merging, audio, metadata, subtitles, chapters, remuxing, concat, and safe moves
Extensions Versioned native RPC and constrained WASM plugins, signed packs, catalogs, and updater transactions

The capability manifest records 94 capabilities: 86 compatible within their declared corpora, 7 partial, and 1 intentional deviation. This summary is enforced against the manifest by repository tests. “Compatible” means the linked deterministic evidence passes within its declared corpus; it does not imply unbounded equivalence with every upstream behavior, account state, region, or future service response.

DRM decryption is not implemented. Experimental SABR/UMP work is outside the general compatibility target. See Project status for the evidence model and principal limitations.

Architecture

VidStow (separate repo)       ytdlp-go CLI       Go application
 engine + providers/youtube       │             engine composition
              │                pkg/ytdlp        or pkg/ytdlp
              └──────────────┬─────┴─────────────────┘
                             │
                           engine
                             │
          extraction → selection → transfer → post-processing
                             │
                  confined artifacts + events

Network state, credentials, JavaScript challenge solving, output policy, archive state, and nested extraction stay within the current operation boundary. Read the architecture overview and architecture decisions for the detailed contracts.

Requirements and releases

  • Go 1.25.12+ for source builds.
  • FFmpeg and FFprobe for adaptive-track merging and requested media operations.
  • ytdlp-js-helper beside the main executable for supported JavaScript challenge flows.
  • Node.js only when rebuilding the JavaScript challenge helper from its upstream source inputs.

No standalone CLI binary release or production updater channel is currently endorsed. Build from a reviewed source revision. See Installation and Current scope for the exact boundary.

Documentation

Document Purpose
Installation Current source-build requirements and verification boundary
VidStow Separate focused desktop application powered by this engine
CLI usage Task-oriented command-line workflows
Go embedding Public library usage and lifecycle
Supported sites Public URL families and known boundaries
Configuration Configuration files, precedence, aliases, and paths
Troubleshooting CLI, helper, FFmpeg, and engine failures
Project status Maturity labels, evidence model, and limitations
Architecture Engine boundaries and operation lifecycle
Documentation index User, developer, architecture, and evidence index
Changelog User-visible changes
Current scope Present interfaces, compatibility boundary, and non-goals

Python-free by design

The main program, extractor registry, network stack, media protocols, compatibility languages, plugin boundaries, updater logic, and JavaScript helper are implemented in Go. FFmpeg and FFprobe remain explicit external media-tool boundaries; they do not introduce a Python runtime.

The repository includes Python-sentinel checks and a strict scratch runtime image. See Python-free runtime evidence.

Development and verification

Run the main repository tests:

go test ./...
go run ./cmd/paritycheck

Contributions should keep claims bounded, preserve fixture provenance, add success and failure tests, and document known deviations. Read Contributing, the fixture policy, and the documentation index before opening a pull request.

  • Use Support for issue routing and diagnostic hygiene.
  • Report security-sensitive findings privately under Security.
  • Review Third-party notices before redistributing dependencies or external tools.

Use the project only for content you are authorized to access and download. Respect service terms, copyright, privacy, access controls, and applicable law. The project does not decrypt DRM or grant rights to third-party media.

Licensed under the Apache License 2.0.

Directories

Path Synopsis
cmd
deltareplay command
diffcheck command
Command diffcheck compares normalized Go and reference snapshots.
Command diffcheck compares normalized Go and reference snapshots.
impersonationcheck command
Command impersonationcheck runs the separately controlled live browser fingerprint canary.
Command impersonationcheck runs the separately controlled live browser fingerprint canary.
jscheck command
Command jscheck verifies the packaged JavaScript helper boundary.
Command jscheck verifies the packaged JavaScript helper boundary.
paritycheck command
Command paritycheck validates the capability manifest.
Command paritycheck validates the capability manifest.
shadowcheck command
shadowcheck compares two bounded semantic observations locally.
shadowcheck compares two bounded semantic observations locally.
telemetrycheck command
Command telemetrycheck merges privacy-safe snapshots and evaluates a local coverage gate.
Command telemetrycheck merges privacy-safe snapshots and evaluates a local coverage gate.
youtube-canary command
Command youtube-canary validates the opt-in YouTube interoperability harness.
Command youtube-canary validates the opt-in YouTube interoperability harness.
ytdlp-go command
Command ytdlp-go is the command-line entry point for the Go port.
Command ytdlp-go is the command-line entry point for the Go port.
ytdlp-js-helper command
Command ytdlp-js-helper runs the isolated JavaScript engine protocol.
Command ytdlp-js-helper runs the isolated JavaScript engine protocol.
ytdlp-ops command
ytdlp-ops validates canary evidence and produces bounded local operations summaries.
ytdlp-ops validates canary evidence and produces bounded local operations summaries.
ytdlp-pack command
ytdlp-plugin-rpc-example command
ytdlp-plugin-rpc-example is a deterministic Plugin ABI v1 SDK example.
ytdlp-plugin-rpc-example is a deterministic Plugin ABI v1 SDK example.
ytdlp-plugin-wasm-example command
ytdlp-plugin-wasm-example writes the deterministic P1 example module to stdout.
ytdlp-plugin-wasm-example writes the deterministic P1 example module to stdout.
ytdlp-release command
ytdlp-update command
Package engine provides provider-neutral media orchestration and an explicit typed provider-composition boundary.
Package engine provides provider-neutral media orchestration and an explicit typed provider-composition boundary.
provider
Package provider defines the cycle-free public contracts between engine orchestration and explicitly composed provider bundles.
Package provider defines the cycle-free public contracts between engine orchestration and explicitly composed provider bundles.
value
Package value implements ordered, heterogeneous metadata values.
Package value implements ordered, heterogeneous metadata values.
internal
archive
Package archive implements yt-dlp-compatible download archive identities and a bounded, concurrency-safe persistent store.
Package archive implements yt-dlp-compatible download archive identities and a bounded, concurrency-safe persistent store.
atomicfile
Package atomicfile provides the low-level, platform-specific commit primitive used by durable engine state.
Package atomicfile provides the low-level, platform-specific commit primitive used by durable engine state.
cache
Package cache implements a bounded, namespaced filesystem cache with safe paths, atomic stores, and explicit expiry.
Package cache implements a bounded, namespaced filesystem cache with safe paths, atomic stores, and explicit expiry.
cli
Package cli implements the command-line boundary.
Package cli implements the command-line boundary.
compat/chapterremove
Package chapterremove parses and evaluates yt-dlp-compatible chapter removal specifications without depending on Python.
Package chapterremove parses and evaluates yt-dlp-compatible chapter removal specifications without depending on Python.
compat/config
Package config implements bounded, source-located configuration discovery and token merging compatible with the principal yt-dlp configuration flow.
Package config implements bounded, source-located configuration discovery and token merging compatible with the principal yt-dlp configuration flow.
compat/matchfilter
Package matchfilter implements the bounded, non-interactive subset of yt-dlp's --match-filters language.
Package matchfilter implements the bounded, non-interactive subset of yt-dlp's --match-filters language.
compat/metadata
Package metadata implements the bounded, Python-free subset of yt-dlp's MetadataParser postprocessor used by --parse-metadata and --replace-in-metadata.
Package metadata implements the bounded, Python-free subset of yt-dlp's MetadataParser postprocessor used by --parse-metadata and --replace-in-metadata.
compat/progress
Package progress renders deterministic yt-dlp-style progress templates.
Package progress renders deterministic yt-dlp-style progress templates.
compat/pyregex
Package pyregex translates the bounded Python regular-expression surface used by compatibility languages to regexp2 engine syntax.
Package pyregex translates the bounded Python regular-expression surface used by compatibility languages to regexp2 engine syntax.
compat/sections
Package sections parses and normalizes yt-dlp-compatible --download-sections specifications into a bounded, ordered list of section ranges.
Package sections parses and normalizes yt-dlp-compatible --download-sections specifications into a bounded, ordered list of section ranges.
compat/simplefilter
Package simplefilter implements the bounded simple metadata filters of yt-dlp's --match-title/--reject-title, --date/--dateafter/--datebefore, --min-views/--max-views, and --age-limit options.
Package simplefilter implements the bounded simple metadata filters of yt-dlp's --match-title/--reject-title, --date/--dateafter/--datebefore, --min-views/--max-views, and --age-limit options.
compat/template
Package template implements the output-template compatibility layers.
Package template implements the output-template compatibility layers.
conformance
Package conformance loads and validates the capability parity manifest.
Package conformance loads and validates the capability parity manifest.
cookies/chromium
Package chromium imports Chromium-family cookies without Python or cgo.
Package chromium imports Chromium-family cookies without Python or cgo.
cookies/chromiumlinux
Package chromiumlinux imports Linux Chromium-family cookies without Python, cgo, or a live browser process.
Package chromiumlinux imports Linux Chromium-family cookies without Python, cgo, or a live browser process.
cookies/chromiumwindows
Package chromiumwindows imports Chromium-family cookies using native Go and Windows DPAPI.
Package chromiumwindows imports Chromium-family cookies using native Go and Windows DPAPI.
cookies/firefox
Package firefox imports cookies from Firefox profiles without Python or cgo.
Package firefox imports cookies from Firefox profiles without Python or cgo.
cookies/netscape
Package netscape reads and writes Netscape/Mozilla cookies.txt files.
Package netscape reads and writes Netscape/Mozilla cookies.txt files.
cookies/safari
Package safari imports Cookies.binarycookies without Python or cgo.
Package safari imports Cookies.binarycookies without Python or cgo.
cookies/snapshot
Package snapshot provides the platform-specific primitives used to copy browser databases without following a path replacement or symlink.
Package snapshot provides the platform-specific primitives used to copy browser databases without following a path replacement or symlink.
cookies/validate
Package validate contains the common bounded validation used by browser cookie importers before values are turned into net/http cookies.
Package validate contains the common bounded validation used by browser cookie importers before values are turned into net/http cookies.
credentials/netrc
Package netrc parses and securely loads bounded native netrc credential stores.
Package netrc parses and securely loads bounded native netrc credential stores.
differential
Package differential compares normalized Go snapshots with attributable reference snapshots without invoking the reference implementation.
Package differential compares normalized Go snapshots with attributable reference snapshots without invoking the reference implementation.
downloader
Package downloader implements resumable direct HTTP downloads.
Package downloader implements resumable direct HTTP downloads.
enginetest
Package enginetest supplies cycle-free fake providers for root engine tests.
Package enginetest supplies cycle-free fake providers for root engine tests.
events
Package events defines structured operation events shared by core components.
Package events defines structured operation events shared by core components.
extraction
Package extraction preserves the historical internal extraction surface through aliases and thin wrappers to the public engine owner.
Package extraction preserves the historical internal extraction surface through aliases and thin wrappers to the public engine owner.
extractor
Package extractor contains concrete first-party extractors and preserves the legacy extraction surface through aliases to internal/extraction.
Package extractor contains concrete first-party extractors and preserves the legacy extraction surface through aliases to internal/extraction.
format
Package format implements media-format selection.
Package format implements media-format selection.
fragment
Package fragment downloads and assembles ordered media fragments.
Package fragment downloads and assembles ordered media fragments.
javascript/ejs
Package ejs integrates the pinned yt-dlp EJS solver bundle with the isolated JavaScript helper.
Package ejs integrates the pinned yt-dlp EJS solver bundle with the isolated JavaScript helper.
javascript/engine
Package engine executes bounded JavaScript requests in fresh pure-Go runtimes while caching only immutable compiled programs.
Package engine executes bounded JavaScript requests in fresh pure-Go runtimes while caching only immutable compiled programs.
javascript/protocol
Package protocol defines the versioned, engine-neutral JavaScript helper boundary.
Package protocol defines the versioned, engine-neutral JavaScript helper boundary.
javascript/supervisor
Package supervisor manages the isolated JavaScript helper process.
Package supervisor manages the isolated JavaScript helper process.
media/ffmpeg
Package ffmpeg supervises ffmpeg and ffprobe without invoking a shell.
Package ffmpeg supervises ffmpeg and ffprobe without invoking a shell.
media/pipeline
Package pipeline composes protocol downloads with supervised media processing.
Package pipeline composes protocol downloads with supervised media processing.
media/postprocess
Package postprocess builds a typed, observable media post-processing graph.
Package postprocess builds a typed, observable media post-processing graph.
network
Package network implements the shared HTTP transport used by extraction and downloading.
Package network implements the shared HTTP transport used by extraction and downloading.
network/impersonate
Package impersonate provides explicitly versioned browser-like transports.
Package impersonate provides explicitly versioned browser-like transports.
operations
Package operations provides bounded, privacy-preserving primitives for canary execution, operational aggregation, and regression repair evidence.
Package operations provides bounded, privacy-preserving primitives for canary execution, operational aggregation, and regression repair evidence.
pack
Package pack implements deterministic, signed plugin-pack verification and atomic installation without relying on a language runtime.
Package pack implements deterministic, signed plugin-pack verification and atomic installation without relying on a language runtime.
pack/catalog
Package catalog implements a signed, deterministic, offline pack catalog.
Package catalog implements a signed, deterministic, offline pack catalog.
pack/transaction
Package transaction binds signed catalog resolution, artifact verification, the v1.x runtime contract, and atomic pack activation into one fail-closed product operation.
Package transaction binds signed catalog resolution, artifact verification, the v1.x runtime contract, and atomic pack activation into one fail-closed product operation.
pack/upgrade
Package upgrade defines the signed compatibility contract used when an extractor pack moves from contract v1.0 to the additive v1.1 schema.
Package upgrade defines the signed compatibility contract used when an extractor pack moves from contract v1.0 to the additive v1.1 schema.
platform/xattrs
Package xattrs provides the tiny platform capability used by the typed post-processing xattrs stage.
Package xattrs provides the tiny platform capability used by the typed post-processing xattrs stage.
plugin
Package plugin implements validation and host policy for pluginapi.
Package plugin implements validation and host policy for pluginapi.
plugin/rpc
Package rpc implements the stable length-prefixed stdio Plugin ABI v1.
Package rpc implements the stable length-prefixed stdio Plugin ABI v1.
plugin/upgrade
Package upgrade provides deterministic conformance evidence for compatible minor revisions of the out-of-process plugin ABI.
Package upgrade provides deterministic conformance evidence for compatible minor revisions of the out-of-process plugin ABI.
plugin/wasm
Package wasm implements the experimental sandboxed WebAssembly plugin host.
Package wasm implements the experimental sandboxed WebAssembly plugin host.
protocol/dash
Package dash parses and downloads the supported DASH subset.
Package dash parses and downloads the supported DASH subset.
protocol/hls
Package hls parses and downloads the supported HLS subset.
Package hls parses and downloads the supported HLS subset.
protocol/ism
Package ism parses and downloads Microsoft Smooth Streaming manifests.
Package ism parses and downloads Microsoft Smooth Streaming manifests.
protocol/youtubelive
Package youtubelive implements bounded YouTube-specific media protocols.
Package youtubelive implements bounded YouTube-specific media protocols.
providers/youtube
Package youtube owns the typed request and complete concrete implementation dependency closure for the first-party YouTube provider family.
Package youtube owns the typed request and complete concrete implementation dependency closure for the first-party YouTube provider family.
release
Package release builds deterministic, Python-free release artifacts and metadata from explicit inputs.
Package release builds deterministic, Python-free release artifacts and metadata from explicit inputs.
sandbox
Package sandbox constructs fail-closed launch plans for hostile out-of- process plugins.
Package sandbox constructs fail-closed launch plans for hostile out-of- process plugins.
session
Package session contains the durable, network-free state boundary for a resumable download session.
Package session contains the durable, network-free state boundary for a resumable download session.
sponsorblock
Package sponsorblock implements a bounded, native SponsorBlock segment client, normalization layer, chapter marking, and pure cut planning derived from the pinned yt-dlp postprocessor reference.
Package sponsorblock implements a bounded, native SponsorBlock segment client, normalization layer, chapter marking, and pure cut planning derived from the pinned yt-dlp postprocessor reference.
telemetry
Package telemetry provides privacy-preserving, bounded-cardinality counters for measuring extractor and capability outcomes.
Package telemetry provides privacy-preserving, bounded-cardinality counters for measuring extractor and capability outcomes.
testserver
Package testserver provides deterministic offline HTTP scenarios for tests.
Package testserver provides deterministic offline HTTP scenarios for tests.
update
Package update implements the Python-free signed updater foundation.
Package update implements the Python-free signed updater foundation.
upstreamdelta
Package upstreamdelta classifies a bounded yt-dlp history window for the bounded maintenance replay.
Package upstreamdelta classifies a bounded yt-dlp history window for the bounded maintenance replay.
value
Package value preserves the historical internal value surface through aliases to the public engine/value owner.
Package value preserves the historical internal value surface through aliases to the public engine/value owner.
youtubecanary
Package youtubecanary provides an opt-in, disabled-by-default YouTube interoperability harness for later operator evidence.
Package youtubecanary provides an opt-in, disabled-by-default YouTube interoperability harness for later operator evidence.
youtubepot
Package youtubepot provides a bounded, secret-safe PO-token provider and cache boundary for YouTube protected playback.
Package youtubepot provides a bounded, secret-safe PO-token provider and cache boundary for YouTube protected playback.
pkg
pluginapi
Package pluginapi defines the stable, language-neutral plugin ABI model.
Package pluginapi defines the stable, language-neutral plugin ABI model.
pluginapi/sdk
Package sdk provides the author-side server for pluginapi's length-prefixed RPC protocol.
Package sdk provides the author-side server for pluginapi's length-prefixed RPC protocol.
ytdlp
Package ytdlp is the broad compatibility facade.
Package ytdlp is the broad compatibility facade.
providers
youtube
Package youtube composes the complete first-party YouTube provider family with the public provider-neutral engine.
Package youtube composes the complete first-party YouTube provider family with the public provider-neutral engine.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL