Skip to content

iSweat-exe/Spicetify-WebSocket-Now-Playing

Repository files navigation

🎵 Spicetify WebSocket Now Playing

Version Spicetify License Discord

Bypass Spotify's API limitations with this lightweight WebSocket extension that streams real-time Spotify data directly from your client. Perfect for developers, streamers, and creators who need instant access to now-playing information without API rate limits or authentication hassles.

✨ Features

🚀 Real-time Data Streaming

  • Instant updates - Get track changes in milliseconds, not seconds
  • No API delays - Direct access to Spotify's internal data
  • Continuous sync - Updates every second, even when Spotify freezes
  • Bypass rate limits - No more 429 errors or quota restrictions

🎯 Complete Track Information

{
  "title": "Song Title",
  "artist": "Artist Name", 
  "album": "Album Name",
  "duration": 240000,
  "progress": 120000,
  "isPaused": false,
  "volume": 0.8,
  "popularity": 85,
  "explicit": false,
  "artwork": "https://i.scdn.co/image/...",
  "timestamp": 1234567890
}

🎮 Full Playback Control

  • ⏯️ Play/Pause - Toggle playback state
  • ⏭️ Next/Previous - Skip tracks seamlessly
  • 🔀 Shuffle - Toggle random playback
  • 🔁 Repeat - Control repeat modes
  • ❤️ Like/Unlike - Manage favorites
  • 🔊 Volume Control - Adjust audio levels
  • 📍 Seek - Jump to any position in track

🛠️ Developer-Friendly

  • WebSocket protocol - Standard, reliable communication
  • JSON format - Easy to parse and integrate
  • Lightweight - Minimal resource usage
  • Auto-reconnection - Handles network interruptions
  • Error handling - Robust and stable operation

🎨 Use Cases

🖥️ Desktop Integration

  • Rainmeter skins - Display current track in system widgets
  • Wallpaper Engine - Create dynamic wallpapers that react to music
  • Desktop apps - Build custom music dashboards and controllers

📺 Streaming & Content Creation

  • OBS overlays - Show now-playing without screen capture
  • Stream alerts - Trigger events on song changes
  • Chat bots - Display current track in Twitch/Discord
  • Recording software - Auto-tag recordings with track info

🌐 Web Applications

  • Music visualizers - Create real-time audio-reactive graphics
  • Social sharing - Auto-post what you're listening to
  • Analytics dashboards - Track your listening habits
  • Remote controls - Control Spotify from any device

🏠 Smart Home & IoT

  • Home Assistant - Integrate with smart home systems
  • LED controllers - Sync lights with music
  • Voice assistants - Get track info via voice commands
  • Automation - Trigger actions based on music activity

🚀 Quick Start

Prerequisites

  • Spicetify installed and configured (Installation Guide)
  • Spicetify version ≥ 2.42.0 (check with spicetify --version)
  • Spotify Desktop App (not web player)

Installation

1️⃣ Download the Extension

# Clone the repository
git clone https://github.com/iSweat-exe/Spicetify-WebSocket-Now-Playing.git
cd Spicetify-WebSocket-Now-Playing

2️⃣ Install to Spicetify

# Copy to Spicetify extensions folder
cp ws-nowPlaying.js "C:\Users\<USERNAME>\AppData\Local\spicetify\Extensions\"

# Or manually copy to:
# Windows: C:\Users\<USERNAME>\AppData\Local\spicetify\Extensions\
# macOS: ~/.config/spicetify/Extensions/
# Linux: ~/.config/spicetify/Extensions/

3️⃣ Apply Changes

# Apply the extension
spicetify apply

# Restart Spotify

4️⃣ Verify Installation

Open Spotify and check the console (F12) for:

[SpicetifyWS-V2] Spicetify ready
[SpicetifyWS-V2] Connected

📡 WebSocket Server

The extension connects to ws://localhost:5684 by default. You'll need a WebSocket server to receive the data.

Basic Server Example (Node.js)

const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 5684 });

wss.on('connection', (ws) => {
    console.log('🎵 Spotify client connected');
    
    ws.on('message', (data) => {
        const track = JSON.parse(data);
        console.log(`Now playing: ${track.artist} - ${track.title}`);
        
        // Your custom logic here
        handleTrackUpdate(track);
    });
    
    // Send commands back to Spotify
    ws.send(JSON.stringify({ action: 'playpause' }));
});

Available Commands

Send JSON commands to control Spotify:

// Playback control
{ "action": "playpause" }
{ "action": "next" }
{ "action": "previous" }

// Volume control (0.0 to 1.0)
{ "action": "setVolume", "volume": 0.5 }

// Seek to position (milliseconds)
{ "action": "setPosition", "position": 120000 }

// Toggle features
{ "action": "toggleShuffle" }
{ "action": "toggleRepeat" }
{ "action": "like" }

🔧 Configuration

Default Settings

const CONFIG = {
    WS_URL: "ws://localhost:5684",
    RECONNECT_DELAY: 3000,
    UPDATE_INTERVAL: 1000,
    MAX_RECONNECT_ATTEMPTS: 5
};

Custom Configuration

Edit the CONFIG object in ws-nowPlaying.js to customize:

  • Port number - Change WebSocket port
  • Update frequency - Adjust data streaming rate
  • Reconnection behavior - Modify retry logic
  • Server URL - Use remote WebSocket servers

🎯 Why Bypass Spotify's API?

Spotify Web API Limitations

  • Rate limits - 429 errors kill your app
  • Authentication complexity - OAuth flows and token management
  • Delayed updates - Polling every 30+ seconds
  • Limited data - Missing internal metadata
  • Quota restrictions - Usage caps for free tier

Direct WebSocket Benefits

  • No rate limits - Stream unlimited data
  • No authentication - Works immediately
  • Real-time updates - Millisecond precision
  • Complete data access - All internal Spotify metadata
  • No quotas - Unlimited usage
  • Offline capable - Works without internet for local control

🛡️ Troubleshooting

Common Issues

"Spicetify not found"

# Verify Spicetify installation
spicetify --version

# Reinstall if needed
curl -fsSL https://raw.githubusercontent.com/spicetify/spicetify-cli/master/install.sh | sh

"WebSocket connection failed"

  • Ensure your WebSocket server is running on port 5684
  • Check firewall settings
  • Verify the server URL in CONFIG

"No track data received"

  • Make sure Spotify is playing music
  • Check browser console for errors (F12)
  • Restart Spotify after installation

"Commands not working"

  • Verify WebSocket server can send messages
  • Check command format (must be valid JSON)
  • Ensure Spotify has focus when sending commands

Debug Mode

Enable detailed logging by opening browser console (F12) in Spotify:

// Check connection status
console.log('[SpicetifyWS-V2] Connection status');

// View current track data
console.log('[SpicetifyWS-V2] Track data:', lastTrack);

🤝 Contributing

We welcome contributions! Here's how to get started:

Development Setup

# Fork and clone the repo
git clone https://github.com/isweat-exe/Spicetify-WebSocket-Now-Playing.git
cd Spicetify-WebSocket-Now-Playing

# Create a feature branch
git checkout -b feature/feature-username-01

# Make your changes and test
# Copy to Spicetify extensions folder for testing
cp ws-nowPlaying.js "C:\Users\YOUR_USERNAME\AppData\Local\spicetify\Extensions"
spicetify apply

# Commit and push
git commit -m "Add feature"
git push origin feature/feature-username-01

Contribution Guidelines

  • 🐛 Bug reports - Use GitHub issues with detailed reproduction steps
  • 💡 Feature requests - Describe your use case and expected behavior
  • 🔧 Code contributions - Follow existing code style and add tests
  • 📚 Documentation - Help improve README and code comments

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Spicetify Team - For the amazing Spotify customization platform
  • Spotify - For the music streaming service we all love
  • WebSocket Community - For the robust real-time communication protocol
  • Contributors - Everyone who helps improve this project

📞 Support


⭐ Star this repo if it helped you bypass Spotify's API limitations! ⭐

Made by developer, for developers

🚀 Get Started📖 Documentation💬 Community

About

Spicetify-WebSocket-Now-Playing

Resources

License

Stars

Watchers

Forks

Releases

No releases published