Skip to main content

mpv-yt

A command-line tool to stream YouTube videos with mpv.

Prerequisites

Requires mpv media player to be installed and available in your system's PATH.

Installation

pip install mpv-yt

Usage

The tool can be invoked with the play command, followed by a YouTube video URL or ID. If no identifier is provided, the tool will prompt for input.

Interactive Mode

Run the command without a video identifier to be prompted for one. Then, select the desired stream quality from the interactive list.

play

Direct Playback

Provide a YouTube URL or video ID directly as an argument.

play "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# or
play dQw4w9WgXcQ

Quality Selection

Specify a video quality to bypass the interactive selection. The tool supports specific resolutions (e.g., 1080p, 720p), highest, or lowest.

play dQw4w9WgXcQ --quality 1080p

Audio-Only Mode

Use the --audio flag to stream only the audio track.

play dQw4w9WgXcQ --audio

Options

Argument Short Description
identifier The YouTube URL or Video ID to play.
--quality <quality> -q Set a preferred quality (e.g., 1080p, highest, lowest).
--audio -a Play audio only.

Metadata

Release files for mpv-yt 1.0.1

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

Source distribution (sdist)

Source distribution for mpv-yt 1.0.1
File Size Uploaded
mpv_yt-1.0.1.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mpv-yt 1.0.1
File Interpreter ABI Platform
mpv_yt-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / mpv_yt-1.0.1.tar.gz

Download URL mpv_yt-1.0.1.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
58e3782a4e38614f7261a82f4eceeb9794ebe438d3155d54101a8b8e6d7692ba
BLAKE2b-256 checksum
How to use checksums
0c99b42b6e887949a4f4b6f35aadf0623eee5c15e7c0cd401b52cdc2a9a0f6d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / mpv_yt-1.0.1-py3-none-any.whl

Download URL mpv_yt-1.0.1-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97753c828fedb681c6e90272a7a560cc16ca421f8a40c0daff333549566d7f9a
BLAKE2b-256 checksum
How to use checksums
82d5a2b923de7d0fcf39d0a42552965be8f1dcb307ac64b91349966610b3532f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

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