Skip to main content

Modern Python CLI for archiving YouTube playlists with media-server metadata support

Project description

ytdl-archiver

ytdl-archiver

Modern Python CLI for archiving YouTube playlists with media-server-friendly sidecar files.

ytdl-archiver

Dependencies

  • Python 3.14+
  • uv
  • FFmpeg on PATH
  • (Recommended) External JavaScript runtime (deno or Node.js) for full yt-dlp extraction compatibility
  • (Recommended) Firefox for browser cookie extraction
  • (Optional) Rust for setup TUI development

Install

Install with uv (recommended):

uv tool install ytdl-archiver

Or with pip:

pip install ytdl-archiver

From source (development):

git clone https://github.com/htmlgxn/ytdl-archiver.git
cd ytdl-archiver
uv sync

Quick Start

1. Run first-time setup

ytdl-archiver archive

If ~/.config/ytdl-archiver/config.toml is missing, setup runs automatically on non-help commands and generates:

  • ~/.config/ytdl-archiver/config.toml
  • ~/.config/ytdl-archiver/playlists.toml

You can also run setup directly:

ytdl-archiver init

2. Define playlists

Edit ~/.config/ytdl-archiver/playlists.toml:

[[playlists]]
id = "UUxxxxxxxxxxxxxxxxxxxxxx"
path = "Music/Example Channel"
name = "Example Music Channel"

[playlists.download]
format = "bestaudio"
write_subtitles = false
write_thumbnail = true

Notes:

  • [[playlists]] entries are loaded from the playlists array.
  • If both playlists.toml and playlists.json exist in the config directory, TOML is preferred.
  • Playlist download overrides accept canonical snake_case keys and yt-dlp-style aliases (for example write_subtitles and writesubtitles).

3. Run archive

ytdl-archiver archive

First-Class Commands

  • archive: download playlists and generate sidecars
  • metadata-backfill: backfill sidecars for already archived IDs in .archive.txt
  • search: discover channels/playlists and append selected entries to playlists.toml
  • convert-playlists: convert legacy JSON playlists files to TOML
  • init: run interactive setup

Artifact Outputs (default behavior)

Successful archive runs produce:

  • Media output (for example .mp4)
  • Metadata sidecars: <stem>.info.json and <stem>.metadata.json
  • Media-server sidecar: <stem>.nfo (when enabled)
  • Container policy defaults to max-quality/no-webm outputs (prefers mp4 when quality-tied, otherwise remuxes to mp4/mkv)
  • Subtitle sidecars (language-suffixed, for example <stem>.en.srt) with embedding enabled by default
  • Thumbnail sidecar (for example <stem>.jpg) when enabled

Help

ytdl-archiver --help
ytdl-archiver archive --help
ytdl-archiver metadata-backfill --help
ytdl-archiver search --help
ytdl-archiver convert-playlists --help
ytdl-archiver init --help

Documentation

  • Docs index: docs/index.md
  • CLI reference: docs/cli.md
  • Configuration reference: docs/configuration.md
  • Terminal output modes: docs/terminal-output.md
  • Development/contributing: docs/development.md
  • Migration notes: MIGRATION.md
  • Release notes (v0.3.0): docs/releases/0.3.0.md
  • Changelog: CHANGELOG.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ytdl_archiver-0.3.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ytdl_archiver-0.3.0-py3-none-any.whl (2.3 MB view details)

Uploaded Python 3

File details

Details for the file ytdl_archiver-0.3.0.tar.gz.

File metadata

  • Download URL: ytdl_archiver-0.3.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ytdl_archiver-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b187c0e703ecc25a32d29bbd32e391d7c0ef318072f6d9d7a4cf571db5d8d4ee
MD5 017b4160a7e133b785df6a87a8392e01
BLAKE2b-256 4b4b58d408e8fe4fbadf73b6bf87585659366206cc8efc8c75fb0e8f5685688f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytdl_archiver-0.3.0.tar.gz:

Publisher: release.yml on htmlgxn/ytdl-archiver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ytdl_archiver-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ytdl_archiver-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ytdl_archiver-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa943ffc06ec3643be6ec3446ea72b5ab85737b145f7ee5c6292373075bf1b9e
MD5 492c9438e4be99dd4f29c89352845711
BLAKE2b-256 82dd3a149335dbdc1b429aa1bf1ed8acf574c5775b95e6941149feeb587072ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for ytdl_archiver-0.3.0-py3-none-any.whl:

Publisher: release.yml on htmlgxn/ytdl-archiver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page