diff --git a/internal/app/context.go b/internal/app/context.go index 106f4b3..d586251 100644 --- a/internal/app/context.go +++ b/internal/app/context.go @@ -209,9 +209,19 @@ func (c *Context) SetSpotify(client spotify.API) { } func (c *Context) cookieSource() (cookies.Source, error) { + // Use explicit cookie path from config if set if c.Profile.CookiePath != "" { return cookies.FileSource{Path: c.Profile.CookiePath}, nil } + // Check if cookies exist at the default path (supports headless servers + // where cookies were copied manually without running auth import) + defaultPath := c.ResolveCookiePath() + if defaultPath != "" { + if _, err := os.Stat(defaultPath); err == nil { + return cookies.FileSource{Path: defaultPath}, nil + } + } + // Fall back to reading from browser browser := c.Profile.Browser if strings.TrimSpace(browser) == "" { browser = "chrome"