βͺ β« β© β¬ βͺ β« β© β¬ βͺ β« β© β¬ βͺ β« β© β¬ βͺ β« β© β¬
Soundwave is a sleek, full-featured web music player that streams audio
directly from YouTube β no API keys, no login, no subscriptions. Just search
and play, wrapped in a gorgeous animated UI.
β¨ Features Β· πΌοΈ Screenshots Β· β‘ Quick Start Β· ποΈ Architecture Β· π€ Contributing
|
|
|
|
| Home β Trending Feed | Now Playing | Queue & Library |
|---|---|---|
| (animated orb bg + card grid) | (player bar with seek + controls) | (sidebar + liked songs) |
Live demo screenshots coming soon β run locally and see for yourself!
| Tool | Version |
|---|---|
| Python | 3.9 + |
| pip | latest |
| yt-dlp | latest (auto-installed) |
# Clone the repository
git clone https://github.com/im-aswajith/soundwave.git
cd soundwave
# Install dependencies
pip install -r requirements.txt
requirements.txtcontains:flask yt-dlp
python app.pyhttp://localhost:5000
That's it. No .env files, no API keys, no database setup. π
soundwave/
β
βββ app.py # Flask backend β search, stream, proxy
βββ requirements.txt
β
βββ templates/
β βββ index.html # Single-page app shell
β
βββ static/
βββ css/
β βββ style.css # Full design system (orbs, player, cards)
βββ js/
βββ app.js # State machine, audio engine, UI logic
Browser Flask (app.py) YouTube / CDN
β β β
β GET /api/stream/:id β β
β ββββββββββββββββββββββΊ β β
β β yt-dlp (subprocess) β
β β βββββββββββββββββββββββββββΊ
β ββββ signed CDN URL βββββββββ
βββββ { url, mime } ββββββ β
β β β
β (if CORS fails) β β
β GET /api/proxy/:id β β
β ββββββββββββββββββββββΊ β Range-aware proxy β
β β βββββββββββββββββββββββββββΊ
βββββ chunked audio βββββββββββββ audio bytes ββββββββ
Fallback chain (client-side, in order):
yt-dlpdirect CDN URL/api/proxy/:idβ Flask streams bytes (fixes CORS)- Invidious instance A
- Invidious instance B
- Piped API
If every strategy fails, an error is shown. The player never auto-skips β user intent is always respected.
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Serves the SPA |
/api/search?q=... |
GET | YouTube search β JSON { results: [...] } |
/api/trending |
GET | Top music hits β JSON { results: [...] } |
/api/stream/:video_id |
GET | Returns { url, content_type } via yt-dlp |
/api/proxy/:video_id |
GET | Range-aware audio proxy (CORS bypass) |
| Key | Action |
|---|---|
Space |
Play / Pause |
β |
Next track |
β |
Previous track |
L |
Like / Unlike current track |
Soundwave works out of the box, but you can tweak these constants in app.py:
# Stream URL cache lifetime (seconds)
CACHE_TTL = 240 # 4 minutes
# Default search result limit
RESULT_LIMIT = 24
# Request timeout for YouTube scraping
FETCH_TIMEOUT = 12 # seconds
# yt-dlp subprocess timeout
YTDLP_TIMEOUT = 25 # seconds| Layer | Technology |
|---|---|
| Backend | Python Β· Flask |
| Audio Extraction | yt-dlp |
| Search | YouTube ytInitialData scraping (no API key) |
| Frontend | Vanilla JS Β· CSS3 |
| Fonts | Syne Β· DM Sans (Google Fonts) |
| Storage | localStorage (liked songs, search history) |
| Animation | Canvas API (particles) Β· CSS keyframes (orbs) |
- π¨ Custom theme / color scheme support
- π± PWA / install-to-homescreen support
- π Additional Invidious/Piped fallback instances
- π Volume memory across sessions
Soundwave is a personal project built for educational purposes. It does not store, redistribute, or host any audio files. All audio is streamed in real time directly from YouTube's CDN via publicly available URLs extracted by yt-dlp.
Please respect YouTube's Terms of Service and your local copyright laws.
Distributed under the MIT License. See LICENSE for details.
{ "id": "dQw4w9WgXcQ", "title": "Never Gonna Give You Up", "channel": "Rick Astley", "duration": "3:32", "views": "1.5B views", "thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/mqdefault.jpg", "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }