Skip to main content

Terminal media player - play music and video from your terminal

Project description

๐ŸŽต Riff โ€” Terminal Media Player

Python Platform License Status

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: mpv and fzf are system binaries installed separately (see Installation above). All Python packages are installed via pip install -r requirements.txt.


๐Ÿ–ฅ๏ธ Platform Notes

Windows

  • Use Windows Terminal (from Microsoft Store) for the best TUI experience
  • mpv must be installed via winget 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:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -m "Add my feature"
  4. Push to your branch: git push origin feature/my-feature
  5. Open a Pull Request

Please open an issue first for major changes so we can discuss the direction.


๐Ÿ“„ License

MIT ยฉ Sapnoneel Barik


Made with โ™ช and Python

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

riff_player-2.0.0.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

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

riff_player-2.0.0-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

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

Hashes for riff_player-2.0.0.tar.gz
Algorithm Hash digest
SHA256 a87d8547e43ebd46b84c6fbe114c90bf218674f8fd0d6881ae51ed6504f3bfe2
MD5 60604679d86b8feef10a69f0c3588638
BLAKE2b-256 ab4ac1df2e6b68262d37e8dd110979c3e31e583c20e80a845d1da000d0752ee7

See more details on using hashes here.

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

Hashes for riff_player-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f48237d34c7e09a7dae64f1fab22cf787d80eb0d57b0081af2988859d8e455e
MD5 77b357233787111fd9608393d02924af
BLAKE2b-256 b9d32af6d45d7b34df9074419cd7f261651b68c36689e4fbd68fd64b01513369

See more details on using hashes here.

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