🎵 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, sync your Spotify and YouTube Music playlists, and save tracks for offline listening — all 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 |
| 📋 Playlists | Save/load local playlists + import from Spotify, YouTube Music, SoundCloud |
| 🔗 Account Sync | Connect your music accounts and mirror your playlists locally |
| 💾 Offline Cache | Download tracks as compressed .opus files for offline listening |
| ⚙️ Configurable | Cache size, sync mode, per-account auto-sync — all user controlled |
| 🪟 Cross-Platform | Windows, Linux, and macOS |
📦 Installation
Option 1 — pip (recommended)
pip install riff-player
Option 2 — Clone from source
git clone https://github.com/Sapnoneel/Riff.git
cd Riff
pip install -r requirements.txt
System dependencies (required)
Windows (PowerShell):
winget install shinchiro.mpv
winget install fzf
Linux (Ubuntu / Debian):
sudo apt install mpv fzf
macOS:
brew install mpv fzf
Verify setup
python riff.py info
All dependencies should show green checkmarks.
🚀 Usage
Playback
# Show help
python riff.py
# 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 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 and save offline in one go
python riff.py stream "lofi hip hop" --save
# 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
Playlists
# Save a playlist manually
python riff.py playlist save "my-mix"
# Load and play a saved playlist
python riff.py playlist load "my-mix"
# List all saved playlists
python riff.py playlist list
# Import from a music platform
python riff.py playlist fetch spotify "Chill Vibes"
python riff.py playlist fetch ytmusic "liked"
python riff.py playlist fetch soundcloud
# Delete a playlist
python riff.py playlist delete "my-mix"
Account Sync
# Connect your accounts (one-time setup)
python riff.py account connect spotify
python riff.py account connect ytmusic
python riff.py account connect soundcloud
# View connected accounts
python riff.py account list
# Sync manually
python riff.py account sync spotify
python riff.py account sync all
# Sync and download everything for offline access
python riff.py account sync all --offline
# Toggle auto-sync on startup (per platform)
python riff.py account autosync spotify on
python riff.py account autosync ytmusic off
Offline Cache
# Save a track for offline listening
python riff.py save "lofi hip hop"
python riff.py save "https://youtu.be/..."
# View cached tracks and space used
python riff.py cache list
# Clear a specific track
python riff.py cache clear "lofi hip hop"
# Clear entire cache
python riff.py cache clear
Configuration
# View all settings
python riff.py config show
# Set cache size limit
python riff.py config set cache.size_limit_mb 2048
# Set cache mode
python riff.py config set cache.mode ask # prompt after every stream
python riff.py config set cache.mode always # silently cache everything
python riff.py config set cache.mode manual # never auto-cache
python riff.py config set cache.mode smart # cache frequently played tracks
# Toggle local file scan on startup
python riff.py config set startup.local_scan true
⌨️ Playback Controls
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 |
🔗 Account Setup Guides
Spotify
- Go to developer.spotify.com/dashboard
- Create an app
- Add Redirect URI:
http://127.0.0.1:8888/callback - Copy your Client ID and Client Secret
- Run
python riff.py account connect spotifyand paste them in
YouTube Music
- Run
python riff.py account connect ytmusic - Follow the browser OAuth flow — credentials are saved automatically
SoundCloud
- Open soundcloud.com in your browser
- Open DevTools → Network tab (
F12) - Reload the page and filter by
api-v2 - Click any request → Headers → copy the value after
Authorization: OAuth - Run
python riff.py account connect soundcloudand paste the token
🗂️ Project Structure
Riff/
├── riff.py # Entry point
├── pyproject.toml # PyPI packaging
├── setup.py
├── requirements.txt
├── riff/
│ ├── __init__.py # Package metadata (v2.0.0)
│ ├── cli.py # All commands and argument parsing
│ ├── 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
│ ├── config.py # User config (~/.riff/config.json)
│ ├── cache.py # Offline cache with LRU eviction
│ ├── playlist.py # Playlist save/load + platform fetch
│ ├── spotify.py # Spotify API integration
│ ├── ytmusic.py # YouTube Music integration
│ ├── soundcloud.py # SoundCloud integration
│ └── sync.py # Startup sync orchestrator
└── tests/
🔧 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 |
| spotipy | ≥ 2.23.0 | Spotify Web API |
| ytmusicapi | ≥ 1.3.0 | YouTube Music API |
Note:
mpvandfzfare system binaries installed separately. All Python packages install automatically viapip install riff-player.
🖥️ Platform Notes
Windows
- Use Windows Terminal for the best TUI experience
mpvinstalled viawinget install shinchiro.mpv- Video plays in a floating mpv window launched from the terminal
- Run scripts inside the venv:
.venv\Scripts\activate
Linux
- Video-in-terminal works best with the kitty terminal
- 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.
📄 License
MIT © Sapnoneel Barik
Metadata
Release files for riff-player 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| riff_player-2.0.1.tar.gz | 29.9 kB | Without provenance | Details for riff_player-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| riff_player-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for riff_player-2.0.1-py3-none-any.whl |
Total release size: 62.0 kB
Release files / riff_player-2.0.1.tar.gz
| Download URL | riff_player-2.0.1.tar.gz |
|---|---|
| Size | 29.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
892a0854612e9f7e867e99d08445251f0af4c7661f8f447cd895c3d7ee5e91ad
|
|
BLAKE2b-256 checksum How to use checksums |
9fad8a31c4761b57d2046ce0552590db6cc654081b8b83a63712724d35faa794
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / riff_player-2.0.1-py3-none-any.whl
| Download URL | riff_player-2.0.1-py3-none-any.whl |
|---|---|
| Size | 32.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d64d819ead020e4fb7785a92c41dd8b9aa229f2803d7cef83ddefe7da831a33
|
|
BLAKE2b-256 checksum How to use checksums |
3aa0a96579669c7431fbd20afefacf85c42a4ae42b2bf19608ffb41b466b14a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for riff-player 2.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.