• v2.0.0 d14095061b

    v2.0.0 Stable

    kerem released this 2026-01-25 21:17:47 +03:00 | 0 commits to main since this release

    📅 Originally published on GitHub: Sun, 25 Jan 2026 18:22:34 GMT
    🏷️ Git tag created: Sun, 25 Jan 2026 18:17:47 GMT

    v2.0.0 - No Authentication Required 🎉

    This is a major release that completely redesigns the package to work without any authentication tokens.

    What's New

    Zero Authentication

    The package now scrapes Spotify's public web pages to extract embedded data. No more dealing with access tokens, client tokens, or OAuth flows!

    // Before (v1.x) - Required tokens
    client := spotify.NewClient(
        spotify.WithAccessToken("..."),
        spotify.WithClientToken("..."),
    )
    
    // Now (v2.0) - Just works!
    client := spotify.NewClient()
    track, _ := client.FetchTrack(ctx, "4cOdK2wGLETKBW3PvgPWqT")
    

    Browser-Like TLS Fingerprinting

    Uses CycleTLS to mimic real browser requests, bypassing Spotify's bot detection.

    💥 Breaking Changes

    Removed Features

    • Search functionality - Search(), SearchWithOptions(), SearchTopResult() removed (not available via HTML scraping)
    • Authentication system - auth/ package removed entirely
    • Token options - WithAccessToken(), WithClientToken(), WithTokenPersistence(), WithAuthManager() removed
    • Auth errors - ErrTokenExpired, ErrTokenNotFound, ErrRequestCanceled, AuthError, IsAuthError() removed

    Go Version Requirement

    • Minimum Go version is now 1.24 (required by CycleTLS dependency)

    Simplified Error Types

    • APIError no longer wraps errors (removed Unwrap() method)
    • WrapAPIError() function removed
    • NewAuthError() function removed

    📦 What's Included

    Feature Status
    Track info (name, duration, album, artists)
    Artist info (name, followers, monthly listeners, bio)
    Album info (name, artists, track list, artwork)
    Cover art URLs
    Play counts ⚠️ Limited (often empty in HTML)
    Search Removed

    🚀 Migration Guide

    1. Update Go version

    # go.mod
    go 1.24
    

    2. Remove authentication code

    // Delete these imports
    // "github.com/FrostBreker/spotify-private-api/auth"
    
    // Delete token-related options
    client := spotify.NewClient(
        // spotify.WithAccessToken("..."),    // Remove
        // spotify.WithClientToken("..."),    // Remove
        // spotify.WithTokenPersistence("..."), // Remove
        spotify.WithDebug(true), // Keep if needed
    )
    

    3. Remove search code

    // These functions no longer exist:
    // client.Search(ctx, "query")
    // client.SearchWithOptions(ctx, "query", opts)
    // client.SearchTopResult(ctx, "query")
    

    4. Update error handling

    // Before
    if errors.IsAuthError(err) { ... }
    if err == errors.ErrTokenExpired { ... }
    
    // After - just remove these checks
    if errors.IsAPIError(err) { ... }
    if errors.IsParseError(err) { ... }
    

    📋 Full Changelog

    Added

    • CycleTLS integration for browser-like TLS fingerprinting
    • HTML scraping to extract embedded initialState data
    • Automatic data extraction without authentication

    Removed

    • search.go, search_test.go - Search functionality
    • models/search.go - Search response types
    • auth/ package - Token management (cache, persistence, manager)
    • cmd/ directory - Debug utilities
    • docs/ directory - Reference documentation
    • Authentication-related client options
    • Authentication-related error types

    Changed

    • Minimum Go version: 1.21 → 1.24
    • HTTP client: standard net/http → CycleTLS BrowserClient
    • Data source: Spotify GraphQL API → HTML page scraping
    • APIError simplified (no longer wraps errors)

    Fixed

    • Bot detection issues (TLS fingerprinting now mimics Chrome)

    📊 Dependencies

    github.com/Danny-Dasilva/CycleTLS/cycletls v1.0.30
    

    🙏 Acknowledgments

    Thanks to CycleTLS for making browser-like requests possible in Go.


    Full Changelog: https://github.com/FrostBreker/spotify-private-api/compare/v1.0.0...v2.0.0

    Full Changelog: https://github.com/FrostBreker/spotify-private-api/compare/v1.0.9...v2.0.0

    Downloads