Skip to main content

Terminal YouTube music player with vim-like bindings

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

simpleplay

simpleplay is a terminal YouTube music player. It searches YouTube in a low-latency mode, plays audio-only through mpv, stops cleanly on Ctrl+C, keeps autoplaying similar songs from the current track's YouTube mix, and mirrors the queue into mpv's internal playlist so next/previous controls stay in sync.

Caveat

The entire thing is vibe-coded. Use at your own risk.

Dependencies

  • python3 3.11+
  • mpv

Optional:

  • ffmpeg is not required for normal playback, but it is useful for local media debugging.
  • A supported JavaScript runtime such as node may help yt-dlp on some YouTube videos.

Install

From PyPI:

pip install simpleplay

pip installs the Python yt-dlp dependency automatically. mpv is still a separate system binary, so pip cannot install it for you.

  • mpv

Install mpv with your OS package manager:

# macOS
brew install mpv

# Debian / Ubuntu
sudo apt install mpv

# Fedora
sudo dnf install mpv

# Arch
sudo pacman -S mpv

# Windows
winget search mpv
winget install <mpv-package-id>

More options: https://mpv.io/installation

From this repo:

python3 -m venv .venv
source .venv/bin/activate
pip install -e .

If you do not want an editable install, you can still run the app directly with python3 -m simpleplay.

Run

Start the UI with no query:

simpleplay

Start with an initial search:

simpleplay "daft punk"

Without installing:

python3 -m simpleplay "khruangbin"

Keybindings

  • / enter search mode with a fresh empty query
  • typing in search mode starts a debounced live search automatically
  • Enter leave search mode and keep the current results
  • Esc leave search mode
  • j / k move through the current list
  • Enter on a search result starts playback
  • after playback starts, the main list becomes Up Next, and Enter on a queued item jumps to it
  • space or p pause or resume
  • h / l seek backward or forward 10 seconds
  • n play the next queued or similar track
  • b go to the previous track, or restart the current track if more than 5 seconds in
  • r cycle loop mode: off -> all -> one
  • g / G jump to the top or bottom of the results list
  • q quit
  • Ctrl+C stop playback and exit cleanly

How autoplay works

When a track starts, simpleplay immediately seeds Up Next from the current search results so the queue is usable right away. In parallel, it asks YouTube for the current video's mix playlist (list=RD<video_id>). Those related tracks are added to the in-memory queue, shown in the Up Next list, and the next few are prefetched for faster transitions.

Notes

  • The only non-Python runtime dependency is mpv. yt-dlp is installed automatically as a Python package dependency.
  • mpv is kept alive as one long-running process and controlled over its IPC socket for better responsiveness.
  • The app keeps its queue mirrored into mpv's internal playlist, so mpv's own next/previous controls can move through the same queue.
  • Search uses a fast YouTube page parser first, with the bundled yt-dlp Python package as fallback when needed.
  • Direct audio stream URLs are cached briefly in memory because YouTube stream URLs expire.
  • The first few search results and queued tracks are prefetched in the background so selecting them is more likely to start from a cached direct audio URL.
  • Playback start prefers a prefetched direct audio URL for a short grace window, then falls back to mpv loading the YouTube watch URL directly if the resolver is not ready yet.
  • If yt-dlp starts failing on some videos due to YouTube extractor changes, update it first.

Commands

Run tests:

python3 -m unittest discover -s tests -v

Format or linting commands are not included because this project is stdlib-only and does not ship a formatter config yet.

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

simpleplay-0.1.1.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

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

simpleplay-0.1.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file simpleplay-0.1.1.tar.gz.

File metadata

  • Download URL: simpleplay-0.1.1.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simpleplay-0.1.1.tar.gz
Algorithm Hash digest
SHA256 75c4960476431aafa6675ca13c1448ee9a60de3c794212551ad1f2d6deb7ef9e
MD5 4a885a9589d741a909b19d77bfec724d
BLAKE2b-256 9d7b93dce2fef6e5c742df834168dc54372ad90711498b1bf629f4ffe56625ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for simpleplay-0.1.1.tar.gz:

Publisher: publish.yml on GeetRakala/simpleplay

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

File details

Details for the file simpleplay-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: simpleplay-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simpleplay-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 777bf9d523ca0c9f05ebe401c7d1c968f09c152ca662b5ad69e051ef2e87b375
MD5 54effda6acbdf2de0703caadababd48a
BLAKE2b-256 0ab87c0fadb4ea6722d073a83ce655d115963cf389346d39a83fae613570b29e

See more details on using hashes here.

Provenance

The following attestation bundles were made for simpleplay-0.1.1-py3-none-any.whl:

Publisher: publish.yml on GeetRakala/simpleplay

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