KeyTune is a media player built with Python, wxPython, and MPV.
It focuses on playlist management, folder browsing, session restore, and persistent user preferences.
- Embedded MPV playback inside a wxPython window
- Tabbed playlists and folder browsing
.m3uand.m3u8playlist loading and saving- Session restore for tabs, playback position, volume, and the current item
- Persistent preferences stored in
settings.json - Recent files, folders, and playlists
- Item search inside the active playlist or folder (
Ctrl+F,F3,Shift+F3) - Sleep timer with preset durations, a custom duration, or an end-of-track stop (
Ctrl+Shift+D) - Built-in equalizer presets plus custom presets
- YouTube Music integration for search, link-based open flows, and library refresh
- Optional YouTube Music related-content autoplay (radio) when a playlist ends
- Python 3.10 or newer
python-mpvinstalled in the active Python environment- A compatible libmpv runtime available in one of these locations:
- a local
mpv/folder - the path pointed to by
MPV_HOME - the path pointed to by
MPV_DLL_DIR - a supported Chocolatey installation path
- a local
-
Clone the repository.
git clone https://github.com/Ed-Fe/KeyTune.git cd KeyTune -
Create and activate a virtual environment.
On Windows:
python -m venv .venv .venv\Scripts\Activate.ps1On Linux or macOS:
python -m venv .venv source .venv/bin/activate -
Install dependencies.
pip install -r requirements.txt
-
Download the MPV runtime for local development.
python scripts/download_mpv_runtime.pyThis helper downloads the latest
mpv-winbuildrelease, extracts the folder containinglibmpv-2.dll, and writes it to./mpv/by default. It depends on7zor 7-Zip to unpack the.7zarchive.If you already have a compatible runtime in another location, you can skip this step and point
MPV_HOME,MPV_DLL_DIR, or a Chocolatey installation to it. -
Run the application.
.venv\Scripts\python.exe src/main.py
Useful project links:
The Windows release workflow is defined in .github/workflows/release-windows.yml. It builds the app, bundles the MPV runtime, compiles the Inno Setup installer (installer/keytune.iss), and publishes KeyTune-Setup.exe plus the matching SHA256 file.
The installer supports both per-user (no admin) and per-machine installs, registers KeyTune for Windows "Default apps", and drives updates: the app downloads KeyTune-Setup.exe and runs it silently to upgrade in place, then relaunches.
For a repeatable end-to-end updater test flow, see docs/update-testing.md.
src/main.py— application entry pointsrc/player/app.py— wx application bootstrapsrc/player/frames/base.py— main window coordinator and mixin compositionsrc/player/frames/ui.py— menus, layout, and UI bindingssrc/player/frames/commands.py— event handlers, dialogs, and shortcutssrc/player/frames/playback.py— playback control and MPV integrationsrc/player/frames/library.py— library mixin compositionsrc/player/frames/library_tabs.py— tab state, selection, and ordering behaviorsrc/player/frames/library_loader.py— background loading for folders and playlistssrc/player/frames/library_navigation.py— folder navigation and browser refresh flowssrc/player/frames/session.py— session capture and restoresrc/player/frames/recents.py— recent items and path helperssrc/player/playlists/models.py— playlist state and playback order helperssrc/player/playlists/titles.py— playlist and folder tab naming helperssrc/player/library/media_scan.py— supported media checks and folder scanning helperssrc/player/library/playlist_io.py—.m3u/.m3u8load and save helperssrc/player/library/browser.py— side panel for playlist and folder navigationsrc/player/library/search_dialog.py— item search dialog (Ctrl+F)src/player/frames/item_search.py— item search coordination and result navigationsrc/player/frames/sleep_timer.py— sleep timer scheduling and countdown handlingsrc/player/sleep_timer/dialog.py— sleep timer configuration dialogsrc/player/preferences/dialog.py— preferences UIsrc/player/preferences/models.py— persistent user settings modelsrc/player/preferences/storage.py— persistent user settings storagesrc/player/session.py— session persistencesrc/player/accessibility.py— shared UI helpers
Contributions are welcome. Start with CONTRIBUTING.md for the recommended workflow, local setup, and validation steps.
In short:
- Fork the repository and create a feature branch.
- Make focused changes that match the existing architecture.
- Run the relevant validation before opening a pull request.
- Describe the behavior change clearly in the PR description.