A Django-based music player for the OCF. Submit YouTube URLs to play music through the server.
Requirements:
- Python 3.12
- uv
- FFmpeg (for audio processing)
For dev
git clone https://github.com/ocf/jukebox-django
cd jukebox-django
uv run python manage.py migrate
uv run python manage.py collectstatic
uv run python manage.py runserverFor prod
git clone https://github.com/ocf/jukebox-django
cd jukebox-django
uv run python manage.py migrate
uv run python manage.py collectstatic
uv run daphne -b 0.0.0.0 -p 8000 config.asgi:applicationGo to http://127.0.0.1:8000/ to access the jukebox.
nix develop
python manage.py runserverOr run:
nix run github:ocf/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