Terminal media player - play music and video from your terminal
Project description
๐ต Riff โ Terminal Media Player
Play music and video from your terminal. Local files or the entire internet.
Riff is a cross-platform terminal media player built in Python. Search your local storage with fuzzy-find, stream from YouTube and 1000+ sites, and control everything without ever leaving the terminal.
โจ Features
| Feature | Description |
|---|---|
| ๐ต Local Playback | Searches your Music, Videos, and Downloads folders automatically |
| ๐ Internet Streaming | Powered by yt-dlp โ YouTube, SoundCloud, and 1000+ sites |
| ๐บ Video Support | Stream or play video files from the terminal |
| ๐ Fuzzy Search | Interactive file picker via fzf |
| ๐ฅ๏ธ TUI Interface | Beautiful full-screen terminal UI via Textual |
| ๐ฟ Metadata Display | Shows title, artist, album from ID3 tags |
| ๐ช Cross-Platform | Windows, Linux, and macOS |
๐ฆ Installation
Step 1 โ Install mpv and fzf
Windows (PowerShell):
winget install shinchiro.mpv
winget install fzf
Linux (Ubuntu / Debian):
sudo apt install mpv fzf
macOS:
brew install mpv fzf
Step 2 โ Clone the repo
git clone https://github.com/Sapnoneel/Riff.git
cd Riff
Step 3 โ Install Python dependencies
pip install -r requirements.txt
Step 4 โ Verify everything is set up
python riff.py info
You should see green checkmarks next to mpv, yt-dlp, and fzf.
๐ Usage
# Show help
python riff.py
# Check dependency status
python riff.py info
# Play a local file directly
python riff.py play "C:/Music/song.mp3"
# Search your local library (interactive fuzzy picker)
python riff.py search "bohemian rhapsody"
# Search for audio files only
python riff.py search "adele" --audio
# Browse your entire media library
python riff.py browse
# Stream audio from YouTube / internet
python riff.py stream "lofi hip hop"
python riff.py stream "https://youtu.be/dQw4w9WgXcQ"
# Stream video
python riff.py video "big buck bunny"
# Queue and shuffle all search results
python riff.py search "pink floyd" --queue --shuffle
# Launch the full TUI interface
python riff.py tui
โจ๏ธ Playback Controls
These controls work inside mpv during playback:
| Key | Action |
|---|---|
Space |
Pause / Resume |
โ / โ |
Seek 5 seconds |
โ / โ |
Seek 1 minute |
9 / 0 |
Volume down / up |
m |
Mute |
f |
Toggle fullscreen (video) |
q |
Quit |
TUI Controls
| Key | Action |
|---|---|
L |
Browse local library |
S |
Focus search bar |
I |
Stream audio from internet |
V |
Stream video from internet |
Enter |
Play selected file |
Q |
Quit |
๐๏ธ Project Structure
Riff/
โโโ riff.py # Entry point
โโโ riff/
โ โโโ __init__.py # Package metadata
โ โโโ cli.py # Argument parsing & command dispatch
โ โโโ player.py # mpv wrapper for local playback
โ โโโ search.py # Local file search + fzf picker
โ โโโ stream.py # Internet streaming via yt-dlp
โ โโโ meta.py # Metadata reader (mutagen)
โ โโโ tui.py # Textual TUI interface
โ โโโ utils.py # Cross-platform helpers
โโโ tests/
โ โโโ __init__.py
โโโ requirements.txt
โโโ setup.py
โโโ .gitignore
โโโ README.md
๐ง Dependencies
| Package | Version | Purpose |
|---|---|---|
| mpv | latest | Media engine for audio and video |
| yt-dlp | โฅ 2024.1.0 | Internet streaming from 1000+ sites |
| fzf | latest | Interactive fuzzy file picker |
| mutagen | โฅ 1.47.0 | Audio metadata / ID3 tag reading |
| textual | โฅ 0.47.0 | Full-screen TUI framework |
| rich | โฅ 13.0.0 | Terminal text formatting |
Note:
mpvandfzfare system binaries installed separately (see Installation above). All Python packages are installed viapip install -r requirements.txt.
๐ฅ๏ธ Platform Notes
Windows
- Use Windows Terminal (from Microsoft Store) for the best TUI experience
mpvmust be installed viawinget install shinchiro.mpv- Video plays in a floating mpv window launched from the terminal
Linux
- Video-in-terminal works best with the kitty terminal (
mpv --vo=kitty) - All other terminals fall back to a floating mpv window
macOS
- Video-in-terminal works with iTerm2
- Install dependencies via Homebrew
๐ค Contributing
Contributions are welcome! Here's how:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m "Add my feature" - Push to your branch:
git push origin feature/my-feature - Open a Pull Request
Please open an issue first for major changes so we can discuss the direction.
๐ License
MIT ยฉ Sapnoneel Barik
Project details
Release history Release notifications | RSS feed
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 riff_player-2.0.0.tar.gz.
File metadata
- Download URL: riff_player-2.0.0.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a87d8547e43ebd46b84c6fbe114c90bf218674f8fd0d6881ae51ed6504f3bfe2
|
|
| MD5 |
60604679d86b8feef10a69f0c3588638
|
|
| BLAKE2b-256 |
ab4ac1df2e6b68262d37e8dd110979c3e31e583c20e80a845d1da000d0752ee7
|
File details
Details for the file riff_player-2.0.0-py3-none-any.whl.
File metadata
- Download URL: riff_player-2.0.0-py3-none-any.whl
- Upload date:
- Size: 30.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f48237d34c7e09a7dae64f1fab22cf787d80eb0d57b0081af2988859d8e455e
|
|
| MD5 |
77b357233787111fd9608393d02924af
|
|
| BLAKE2b-256 |
b9d32af6d45d7b34df9074419cd7f261651b68c36689e4fbd68fd64b01513369
|