Skip to main content

emby-cli

PyPI License: CC BY-NC 4.0

CLI to search, play, and download/backup original media files from an Emby server via its REST API. Only HTTP access is required (default port 8096) — no SSH or rsync.

Install

pip install emby-cli

Development (from a clone of this repo):

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

Configuration

Set environment variables (or pass CLI flags):

Variable Description
EMBY_SERVER Server URL (required for most commands)
EMBY_API_KEY API key (or use username/password)
EMBY_USERNAME / EMBY_PASSWORD Name/password auth
EMBY_OUTPUT Download directory (default ./downloads)
EMBY_METHOD download, stream, or hls
EMBY_PLAYER External player for play
EMBY_ITEM_ID Default for --id (item mode / play)
EMBY_CACHE_DIR Credentials directory (default ~/.cache/emby-cli; file auth.json)
EMBY_NO_AUTH_CACHE Set to 1 to disable reading/writing the AccessToken cache

See .env.example. The app does not load .env itself — source it or export vars.

With username/password, sessions are stored in a single kubeconfig-style auth.json (contexts + current_context). emby-cli login saves a server entry and makes it active. Without --server, commands use the active server. Manage entries with emby-cli config (current-server, get-servers, use-server, view). API keys are not stored.

Usage

emby-cli help
emby-cli login
emby-cli logout
emby-cli config get-servers
emby-cli config use-server 'user@http://emby:8096'
emby-cli config current-server
emby-cli config view
emby-cli version
emby-cli info
emby-cli search --media-item --search "Title"
emby-cli search --media-item --search "Title" --count 50
emby-cli search --media-item --id 123456
emby-cli search --media-item --all
emby-cli search --library --all
emby-cli search --library --id 614156
emby-cli search --library --search "PELICULAS"

emby-cli download --media-item --id 123456
emby-cli download --media-item --search "californication S01E01" --pick-best-item
emby-cli download --library --id 12345
emby-cli download --library --search "PELICULAS 4K"
emby-cli download --from-file titles.txt --dry-run

emby-cli play --id 123456
emby-cli play --search "Pelicula (1980)" --pick-best-item

info reports libraries and totals from GET /Items/Counts (totals may include multiple versions of the same title).

Title resolution (play --search, download --media-item --search, download --from-file) is strict by default (year mismatch or multiple matches fail). Pass --pick-best-item to auto-select the best ≤1080p version. With --from-file / --media-item --search, a season line like Show S01 downloads the whole season (same pick-best rule per episode version). Library --search requires an exact name match (case-insensitive); no pick-best.

--dry-run / -n works for all download modes (no files written).

Download methods (-m / EMBY_METHOD):

  • downloadGET /Items/{id}/Download
  • stream — DirectStreamUrl / original.* (Emby Web style)
  • hls — HLS segments remuxed to .mkv (needs static-ffmpeg)

Development

pip install -e ".[dev]"
pytest -q
python -m build && twine check dist/*

To publish a release, tag vX.Y.Z and push it (or create a GitHub Release). CI builds the package and publishes to PyPI via Trusted Publisher.

License

CC BY-NC 4.0

Release files for emby-cli 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emby-cli 0.3.0
File Size Uploaded
emby_cli-0.3.0.tar.gz 40.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for emby-cli 0.3.0
File Interpreter ABI Platform
emby_cli-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 114.2 kB

Release files / emby_cli-0.3.0.tar.gz

Download URL emby_cli-0.3.0.tar.gz
Size 40.1 kB
Tags Source
SHA-256 checksum
How to use checksums
772cb3ad1145039e8e79bf6658fbb4f03b340049a547f31154fbc0771f3e562c
BLAKE2b-256 checksum
How to use checksums
9299388014e229e93a7f7f83cb49fe938c0196311ec368b5e3f6e0c0477dced5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release files / emby_cli-0.3.0-py3-none-any.whl

Download URL emby_cli-0.3.0-py3-none-any.whl
Size 74.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03a94f2bf8600ebc55366074cc91c2fe83977096b01004010dbec576a8adfc4d
BLAKE2b-256 checksum
How to use checksums
89b0435b8c082537ad5523a5a04275c402b151d12064ea8ebde1718f4ee44495
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page