[GH-ISSUE #1237] called Result::unwrap() on an Err value: AuthenticationError(LoginFailed(PremiumAccountRequired)) #566

Closed
opened 2026-02-27 19:31:18 +03:00 by kerem · 1 comment
Owner

Originally created by @thedtvn on GitHub (Jan 1, 2024).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1237

Describe the bug
I log in using freemium Account

To reproduce
Steps to reproduce the behavior:

  1. use librespot in rust to connect
  2. using this code
use librespot::{core::{session::Session, spotify_id::SpotifyId, config::SessionConfig, cache::Cache}, discovery::Credentials};

#[tokio::main]
async fn main() {

    let username = "...";
    let password = "...";

    let session_config = SessionConfig::default();
    
    let credentials = Credentials::with_password(username, password);

    let track = SpotifyId::from_base62("7M3iYY1TiF6D01rwxDz1ey").unwrap();   
    let cache = Cache::new(Some("./credentials"), None, None, None).unwrap();
    println!("Connecting...");
    let (session, _credentials) = Session::connect(session_config, credentials, Some(cache), true).await.unwrap();
    println!("Connected");
}

ver info

librespot = { version = "0.4.2" }
  1. then run cargo run
  2. See error
    image

Host (what you are running librespot on):

  • OS: Windows 11 preview
  • Platform: Dell Laptop

Additional context
I has code some in java using
https://github.com/librespot-org/librespot-java
but it has no error like this

Originally created by @thedtvn on GitHub (Jan 1, 2024). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1237 **Describe the bug** I log in using freemium Account **To reproduce** Steps to reproduce the behavior: 1. use librespot in rust to connect 2. using this code ```rs use librespot::{core::{session::Session, spotify_id::SpotifyId, config::SessionConfig, cache::Cache}, discovery::Credentials}; #[tokio::main] async fn main() { let username = "..."; let password = "..."; let session_config = SessionConfig::default(); let credentials = Credentials::with_password(username, password); let track = SpotifyId::from_base62("7M3iYY1TiF6D01rwxDz1ey").unwrap(); let cache = Cache::new(Some("./credentials"), None, None, None).unwrap(); println!("Connecting..."); let (session, _credentials) = Session::connect(session_config, credentials, Some(cache), true).await.unwrap(); println!("Connected"); } ``` ver info ``` librespot = { version = "0.4.2" } ``` 3. then run `cargo run` 4. See error ![image](https://github.com/librespot-org/librespot/assets/80153297/3562a2ae-a466-4742-b5eb-2467843c294c) **Host (what you are running `librespot` on):** - OS: Windows 11 preview - Platform: Dell Laptop **Additional context** I has code some in java using https://github.com/librespot-org/librespot-java but it has no error like this
kerem 2026-02-27 19:31:19 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@thedtvn commented on GitHub (Jan 1, 2024):

fixed by using

librespot = { git = "https://github.com/librespot-org/librespot"}
<!-- gh-comment-id:1873252414 --> @thedtvn commented on GitHub (Jan 1, 2024): fixed by using ``` librespot = { git = "https://github.com/librespot-org/librespot"} ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#566
No description provided.