Skip to content

im-aswajith/soundwave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 

Repository files navigation

Soundwave Banner

Stars Forks Issues Python Flask License


 β™ͺ  β™«  β™©  ♬  β™ͺ  β™«  β™©  ♬  β™ͺ  β™«  β™©  ♬  β™ͺ  β™«  β™©  ♬  β™ͺ  β™«  β™©  ♬

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


✨ Features

🎡 Playback

  • Multi-fallback audio engine β€” tries yt-dlp direct, Flask proxy, Invidious, and Piped in sequence for maximum reliability
  • Seek support with Range request proxying
  • Shuffle & Repeat modes
  • Prev / Next track navigation
  • 4-minute stream URL caching for snappy replays

πŸ” Discovery

  • Instant YouTube search β€” no API key required, scrapes ytInitialData
  • Trending feed on home screen
  • Global search bar with recent history & live suggestions
  • Time-aware greeting (Morning / Afternoon / Evening)

πŸ’œ Library

  • Liked Songs β€” persisted to localStorage
  • Queue view β€” see what's playing next
  • Sidebar library with liked song quick-launch
  • Keyboard shortcut L to like the current track instantly

🎨 UI / UX

  • Animated particle canvas background with connected-dot physics
  • Floating gradient orbs in the background scene
  • Responsive β€” full mobile layout with slide-out sidebar
  • Skeleton loaders while content fetches
  • Toast notifications for user actions

πŸ–ΌοΈ Screenshots

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!


⚑ Quick Start

Prerequisites

Tool Version
Python 3.9 +
pip latest
yt-dlp latest (auto-installed)

1 β€” Clone & Install

# Clone the repository
git clone https://github.com/im-aswajith/soundwave.git
cd soundwave

# Install dependencies
pip install -r requirements.txt

requirements.txt contains:

flask
yt-dlp

2 β€” Run

python app.py

3 β€” Open

http://localhost:5000

That's it. No .env files, no API keys, no database setup. πŸŽ‰


πŸ—οΈ Architecture

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

How Streaming Works

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):

  1. yt-dlp direct CDN URL
  2. /api/proxy/:id β€” Flask streams bytes (fixes CORS)
  3. Invidious instance A
  4. Invidious instance B
  5. Piped API

If every strategy fails, an error is shown. The player never auto-skips β€” user intent is always respected.


πŸŽ›οΈ API Reference

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)

Result object shape

{
  "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"
}

⌨️ Keyboard Shortcuts

Key Action
Space Play / Pause
β†’ Next track
← Previous track
L Like / Unlike current track

πŸ”§ Configuration

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

πŸ› οΈ Tech Stack

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)

Good first issues

  • 🎨 Custom theme / color scheme support
  • πŸ“± PWA / install-to-homescreen support
  • 🌐 Additional Invidious/Piped fallback instances
  • πŸ”Š Volume memory across sessions

⚠️ Disclaimer

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.


πŸ“„ License

Distributed under the MIT License. See LICENSE for details.


footer wave

Made with πŸ’œ and a lot of music

⭐ If Soundwave made your day better, please consider starring the repo!

Star History Chart

About

🎡 A sleek, no-account web music player that streams YouTube audio in real time. Search anything, hit play β€” yt-dlp handles the rest through a smart multi-fallback engine. Built with Flask, Vanilla JS, and a gorgeous animated UI featuring particle effects and gradient orbs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors