mbharanya / Spotify-To-Beatsaber

Import your favorite songs from Spotify to Beatsaber
11 stars 0 forks source link

All results return a 403 #1

Closed NessDan closed 4 years ago

NessDan commented 4 years ago

Not sure if this is due to beatsaver.com explicitly doing this, but when running the script, this is what I see:

nessdan@DESKTOP-OFN7TFF:~/Spotify-To-Beatsaber$ java -jar ./spotify-2-beatsaber-assembly-0.1.jar MYTOKENREDACTED
Fetching from Spotify: .................................................................
Searching for Taylor Swift Safe & Sound - from The Hunger Games Soundtrack
java.io.IOException: Server returned HTTP response code: 403 for URL: https://beatsaver.com/api/search/text/0?q=taylor+swift+safe+%26+sound+-+from+the+hunger+games+soundtrack
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1919)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1515)
        at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
        at java.base/java.net.URL.openStream(URL.java:1140)
        at org.apache.commons.io.IOUtils.toString(IOUtils.java:1198)
        at BeatsaverSongResource.$anonfun$find$1(SongResource.scala:35)
        at scala.util.Try$.apply(Try.scala:213)
        at BeatsaverSongResource.find(SongResource.scala:33)
        at SpotifyToBeatsaber$.$anonfun$main$7(SpotifyToBeatsaber.scala:33)
        at scala.collection.immutable.List.map(List.scala:286)
        at SpotifyToBeatsaber$.$anonfun$main$6(SpotifyToBeatsaber.scala:31)
        at scala.util.Success.$anonfun$map$1(Try.scala:255)
        at scala.util.Success.map(Try.scala:213)
        at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
        at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
        at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
()
Could not find Taylor Swift Safe & Sound - from The Hunger Games Soundtrack: Server returned HTTP response code: 403 for URL: https://beatsaver.com/api/search/text/0?q=taylor+swift+safe+%26+sound+-+from+the+hunger+games+soundtrack

Could the service possibly be blocking the script? When I visit the URL in my browser, it loads just fine.

mbharanya commented 4 years ago

Hi there, thanks for bringing this to my attention. It seems that beatsaver.com has put in cloudflare protection:

<title>Access denied | beatsaver.com used Cloudflare to restrict access</title>

I've committed some changes to fix it

mbharanya commented 4 years ago

@NessDan Please see the updated command, as a new jar version has been published

NessDan commented 4 years ago

Hey @mbharanya thank you but a new error now appears!

image

nessdan@DESKTOP-OFN7TFF:~/Spotify-To-Beatsaber$ java --version
openjdk 11.0.7 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)
mbharanya commented 4 years ago

@NessDan Thanks, the issue was caused by scala 2.13 incompatibility with a library. Please try again

NessDan commented 4 years ago

It is working now @mbharanya ! Thank you for your hard work on this!

mbharanya commented 4 years ago

Always nice to see others use my work!

NessDan commented 4 years ago

And I appreciate you making it! I had so much fun going through my songs, it made me really fall in love with Beat Saber :) I appreciate it!!

On Tue, Apr 28, 2020 at 5:29 AM Milan Bharanya notifications@github.com wrote:

Always nice to see others use my work!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/mbharanya/Spotify-To-Beatsaber/issues/1#issuecomment-620490629, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACKJDJDPNIETT2G7DPCSB3RO2OXFANCNFSM4MRNKVEQ .