Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localhost refused to connect from Docker #65

Open
fernandesafp opened this issue Nov 28, 2024 · 4 comments
Open

localhost refused to connect from Docker #65

fernandesafp opened this issue Nov 28, 2024 · 4 comments

Comments

@fernandesafp
Copy link

I'm running slsk-batchdl from Docker.

After running:

sldl spotify-likes -c /config/sldl.conf -n 1 --print-tracks

I get:

Unable to open URL, manually open: https://accounts.spotify.com/authorize?client_id=CLIENT_ID&response_type=code&redirect_uri=http%3a%2f%2flocalhost%3a48721%2fcallback&scope=user-library-read+playlist-read-private+playlist-read-collaborative

I tried to open the link but it says connection refused, site can't be reached.

If I run the command outside Docker it works fine. How am I supposed to have this running from Docker?

@fiso64 fiso64 assigned fiso64 and unassigned fiso64 Dec 15, 2024
@l0ckbee
Copy link

l0ckbee commented Dec 26, 2024

@fernandesafp did you find a work around for this? I am running into the same issue.

@fernandesafp
Copy link
Author

@fernandesafp did you find a work around for this? I am running into the same issue.

Unfortunately not, gave up on it.

@loganank
Copy link

loganank commented Jan 2, 2025

Similar issue for me. I'm running the downloader on a headless linux server, so I need a way to authorize without opening a browser on the server. Maybe a configuration parameter that has the auth code?

@l0ckbee
Copy link

l0ckbee commented Jan 3, 2025

@loganank and @fernandesafp

I was able to resolve this issue - a few notes from my troubleshooting:

You will need to obtain your Spotify Refresh Token using a separate container/machine with access to a web browser that supports JavaScript rendering i.e Firefox or Chromium. Spotify's authorization URL uses JavaScript rendering, so terminal based browsers such as lynx and w3m will not allow you to authenticate. The Dockerfile for this repo does not come with a window manager preinstalled, so trying to open a web browser from the container will be more work than its worth.

Therefore I recommend doing the following:

  • Install sldl on a container/machine with a modern web browser such as Firefox
  • run sldl spotify-likes -c <path to your sldl.conf file> and authorize your Spotify account using the web auth flow
  • At this point your sldl.conf will now have the spotify-refresh field automatically populated
  • Transfer the updated sldl.conf to your headless container
  • sldl should now be able to authorize successfully

Hope this helps :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants