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
python33.11+mpv
Optional:
ffmpegis not required for normal playback, but it is useful for local media debugging.- A supported JavaScript runtime such as
nodemay helpyt-dlpon 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
Enterleave search mode and keep the current resultsEscleave search modej/kmove through the current listEnteron a search result starts playback- after playback starts, the main list becomes
Up Next, andEnteron a queued item jumps to it spaceorppause or resumeh/lseek backward or forward 10 secondsnplay the next queued or similar trackbgo to the previous track, or restart the current track if more than 5 seconds inrcycle loop mode:off->all->oneg/Gjump to the top or bottom of the results listqquitCtrl+Cstop 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-dlpis installed automatically as a Python package dependency. mpvis 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, sompv's own next/previous controls can move through the same queue. - Search uses a fast YouTube page parser first, with the bundled
yt-dlpPython 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
mpvloading the YouTube watch URL directly if the resolver is not ready yet. - If
yt-dlpstarts 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simpleplay-0.1.0.tar.gz.
File metadata
- Download URL: simpleplay-0.1.0.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ede185ee73eee811dadc0934c707141652500c7effd34b7c93bbbd671c064ef
|
|
| MD5 |
d21e4dfe03c01f06db471eb97a8207ec
|
|
| BLAKE2b-256 |
ecaea6cfaa56e798ee2d2c425bcdbeb90b36b468d022b34fabf064e10bd38e1a
|
Provenance
The following attestation bundles were made for simpleplay-0.1.0.tar.gz:
Publisher:
publish.yml on GeetRakala/simpleplay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simpleplay-0.1.0.tar.gz -
Subject digest:
5ede185ee73eee811dadc0934c707141652500c7effd34b7c93bbbd671c064ef - Sigstore transparency entry: 1074987709
- Sigstore integration time:
-
Permalink:
GeetRakala/simpleplay@227645a3ed48dcd63c1e770aa08652c38626addb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/GeetRakala
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@227645a3ed48dcd63c1e770aa08652c38626addb -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file simpleplay-0.1.0-py3-none-any.whl.
File metadata
- Download URL: simpleplay-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f26d15f7328eda19094ce7d1f7c6aa4d13d65b435f324dc9c2768c14287b402
|
|
| MD5 |
a1a94a4f60dbe0f9557bb135df5e34a7
|
|
| BLAKE2b-256 |
552d4cfce55665f4a0f78e43a5e186f485eae031c43c3c23200df80ed3527d8d
|
Provenance
The following attestation bundles were made for simpleplay-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on GeetRakala/simpleplay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simpleplay-0.1.0-py3-none-any.whl -
Subject digest:
4f26d15f7328eda19094ce7d1f7c6aa4d13d65b435f324dc9c2768c14287b402 - Sigstore transparency entry: 1074987761
- Sigstore integration time:
-
Permalink:
GeetRakala/simpleplay@227645a3ed48dcd63c1e770aa08652c38626addb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/GeetRakala
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@227645a3ed48dcd63c1e770aa08652c38626addb -
Trigger Event:
workflow_dispatch
-
Statement type: