A Django-based music player for the OCF. Submit YouTube URLs to play music through the server.
Requirements:
- Python 3.10-3.12
- Poetry
- FFmpeg (for audio processing)
git clone https://github.com/ocf/jukebox-django
cd jukebox-django
poetry install
poetry run python manage.py runserverGo to http://127.0.0.1:8000/ to access the jukebox.
nix develop
python manage.py runserverOr build and run:
nix build
./result/bin/jukebox-djangojukebox-django/
├── manage.py # Django management script
├── config/ # Django project settings
│ ├── settings.py
│ ├── urls.py
│ └── asgi.py # ASGI config with WebSocket routing
├── jukebox/ # Main application
│ ├── views.py # Dashboard view
│ ├── consumers.py # WebSocket handler
│ ├── controller.py # Audio playback controller
│ ├── lyrics.py # Lyrics fetching
│ ├── templates/ # HTML templates
│ └── static/ # CSS, JS, images
└── pyproject.toml
- User submits a YouTube URL via the web interface
- The URL is sent to the server via WebSocket
yt-dlpdownloads the audiojust-playbackplays the audio on the server- Real-time updates (now playing, queue, lyrics) are pushed to all connected clients
{
inputs.jukebox-django.url = "github:ocf/jukebox-django";
outputs = { self, nixpkgs, jukebox-django, ... }: {
nixosConfigurations.yourSystem = nixpkgs.lib.nixosSystem {
modules = [
({ pkgs, ... }: {
systemd.services.jukebox = {
description = "Jukebox Service";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
ExecStart = "${jukebox-django.packages.${pkgs.system}.default}/bin/jukebox-django 8000";
Restart = "always";
};
};
})
];
};
};
}