A self-hosted Discord music bot with a live clip page that shows the video in sync.
djsnake plays what you paste in your voice channel: YouTube, Spotify, SoundCloud, Bandcamp, Deezer and Apple Music links, live streams, radios, or plain text searches. The bot posts a link to a clip page that shows the video in sync and controls the queue. Free, for good: MIT licence, no paid edition.
djsnake is an independent project, not affiliated with or endorsed by YouTube, Spotify or Discord.
In the Discord Developer Portal, create an application and add a bot. Enable the Message Content Intent and invite it with the bot and applications.commands scopes. Then:
git clone https://github.com/selfhostr/djsnake.git && cd djsnake
cp .env.example .env # set DISCORD_TOKEN
docker compose pull && docker compose up -dJoin a voice channel and send !play https://www.youtube.com/watch?v=.... The clip page listens on 127.0.0.1:47823: put a reverse proxy in front and set PUBLIC_BASE_URL to share it. Back up ./data with python -m djsnake.backup create. Details: installation, configuration, backup.
- Many sources. Spotify, Deezer and Apple Music playlists are matched on YouTube with no account or API key.
- Full queue control. Per-server queue, loop, shuffle, crossfade, autoplay, 24/7 mode, vote-to-skip and a DJ role.
- Automix. SponsorBlock cuts, loudness normalised to -14 LUFS, silence trimmed, fades.
- Hybrid commands. Every command works as
!nameand as a slash command (commands). - Clip page. Synced video, lyrics from LRCLIB, listening stats, eight themes, installable as an app (guide).
- Saved playlists, audio filters and Last.fm scrobbling.
- Four languages. English, French, Spanish and German, chosen per server.
- Ops-friendly. Health check, optional Prometheus metrics, automatic backups, self-updating yt-dlp (keeping YouTube working).
One Python process runs the discord.py bot and the clip page web server, with yt-dlp and ffmpeg for audio and video. A pot-provider sidecar supplies YouTube PO tokens. State lives in JSON files and SQLite databases under DATA_DIR. See architecture.
- Spotify, Deezer and Apple Music links are matched to YouTube videos, so the match can be the wrong version of a song.
- Tracks are fully downloaded before they play, at most 720p.
- Age-restricted and members-only videos need YouTube cookies from a throwaway account.
- Anyone who has the control link can control the queue. Treat it as a secret.
- For personal use. Respect YouTube's Terms of Service and the rights of the people whose videos you play.
Issues and pull requests are welcome: CONTRIBUTING.md. Security issues: SECURITY.md.
MIT, see LICENSE. Provided "as is", without warranty of any kind.
djsnake is free and has no company behind it. If it saves you time: sponsor us on GitHub.