entriphy / sp-playcount-librespot

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

TravelRestriction error #11

Closed surfmore closed 3 years ago

surfmore commented 4 years ago

Describe the bug When I run the program it is giving the following error.

To Reproduce java -jar sp-playcount-librespot-v1.4.jar user pass

** Error 2020-08-09 01:15:16,328 INFO ApResolver:66 - Loaded aps into pool: {accesspoint=[guc3-accesspoint-b-rf1j.ap.spotify.com:4070, guc3-accesspoint-b-m208.ap.spotify.com:443, guc3-accesspoint-b-fssp.ap.spotify.com:80, guc3-accesspoint-b-70kt.ap.spotify.com:4070, guc3-accesspoint-b-dppf.ap.spotify.com:443, guc3-accesspoint-b-zkw2.ap.spotify.com:80, gae2-accesspoint-c-zk7b.ap.spotify.com:4070, gew1-accesspoint-b-9v0l.ap.spotify.com:443, gew1-accesspoint-b-g7br.ap.spotify.com:80], dealer=[guc-dealer.spotify.com:443, gew-dealer.spotify.com:443, gae-dealer.spotify.com:443], spclient=[guc-spclient.spotify.com:443, gew-spclient.spotify.com:443, gae-spclient.spotify.com:443]} 2020-08-09 01:15:16,563 INFO Session:94 - Created new session! {deviceId: c70f928698cc099e39bddfd469f7de38e3b805db, ap: guc3-accesspoint-b-dppf.ap.spotify.com:443} 2020-08-09 01:15:17,422 INFO Session:223 - Connected successfully! Exception in thread "main" xyz.gianlu.librespot.core.Session$SpotifyAuthenticationException: TravelRestriction at xyz.gianlu.librespot.core.Session.authenticatePartial(Session.java:311) at xyz.gianlu.librespot.core.Session.authenticate(Session.java:231) at xyz.gianlu.librespot.core.Session$Builder.create(Session.java:583) at xyz.gianlu.librespot.Main.main(Main.java:18)

annadnl commented 3 years ago

figured this one out: you need to create your spotify in the same country where your server is running. for example, if you deploy on amazon in the Frankfurt region, the account needs to be a German one (any vpn will do for the account creation)

entriphy commented 3 years ago

Closing this issue since it seems that there's no way to fix this, as the restriction is on Spotify's side. annadnl's solution is the only way around this AFAIK.