entriphy / sp-playcount-librespot

Modification of librespot-java to provide play count info from Spotify
Apache License 2.0
120 stars 18 forks source link

Exception in thread "main" xyz.gianlu.librespot.core.Session$SpotifyAuthenticationException: PremiumAccountRequired #25

Closed sthlmsrille closed 1 year ago

sthlmsrille commented 1 year ago

Describe the bug When starting the application error "PremiumAccountRequired" occurs

To Reproduce Start the application

Expected behavior To be able to login

Screenshots/Stracktraces/Logs Screenshots if applicable, stacktrace and log is a crash occurred.

Version/Commit 1.4.1

Issue seem related to this in LibreSpot: https://github.com/librespot-org/librespot-java/issues/614

zachyf commented 1 year ago

I'm also seeing this error! Please keep me posted on what you find.

longgtruong commented 1 year ago

Same error here

jpgrovy commented 1 year ago

Same issue... for the record. My account is a premium account as well.

jpgrovy commented 1 year ago

@sthlmsrille @zachyf @longgtruong

I saw this post saying to just change the version number.

The fix is to provide a newer client version at https://github.com/librespot-org/librespot-java/blob/0a8e685/lib/src/main/java/xyz/gianlu/librespot/Version.java#L72. Specifying 117300517 from https://github.com/librespot-org/librespot/blob/ae8387a/core/src/version.rs#L20 makes the login work again.

Can someone try using this version number "117300517" instead and see if it works? It will take me a few days to get access to my computer with this on it :(

It looks like the Version.java file needs to be updated

Current code and version looks like this

public static BuildInfo standardBuildInfo() { return BuildInfo.newBuilder() .setProduct(Product.PRODUCT_CLIENT) .addProductFlags(ProductFlags.PRODUCT_FLAG_NONE) .setPlatform(Version.platform()) .setVersion(112800721) .build(); }

zachyf commented 1 year ago

Yep that worked for me.

sthlmsrille commented 1 year ago

I've never compiled a Java application, could you upload a jar or guide me how to do it? 😁

Webchantment commented 1 year ago

I re-compiled it with the new version number. Works fine now. sp-playcount-librespot.zip

marclind commented 1 year ago

That's awesome! I also have no experience in java... How do you pass username and password to the re-complied one? Doesnt seem to work running the file together with "USER=username PASSWORD=password".

Webchantment commented 1 year ago

From the command line...

1) Run the JAR: java -jar librespot-core-jar-with-dependencies.jar username password

You only need to provide your Spotify username and password once. After creds.json has been generated, the username and password are not required in the launch arguments.

2) Run the JAR again: java -jar librespot-core-jar-with-dependencies.jar

entriphy commented 1 year ago

Fixed in v1.4.2.