[GH-ISSUE #82] [Bug Report] OAuth Server Returns Empty Response #72

Closed
opened 2026-02-27 04:57:21 +03:00 by kerem · 6 comments
Owner

Originally created by @tcurdt on GitHub (Sep 18, 2025).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/82

Originally assigned to: @Googolplexed0 on GitHub.

Zotify Version

2c2bb8d

Bug Description

After starting zotify it presents the auth url.
This redirects back to the server running on 4381.
But the server returns "empty response".

Just cross-checking with curl

curl http://127.0.0.1:4381/login
curl: (52) Empty reply from server

Bug Triggering Command

Error Traceback / Logs

Not sure where to find that.

Config File

{
    "ROOT_PATH": "~/Music/Zotify Music",
    "SAVE_CREDENTIALS": "True",
    "CREDENTIALS_LOCATION": "",
    "OUTPUT": "",
    "OUTPUT_PLAYLIST": "{playlist}/{artist}_{song_name}",
    "OUTPUT_PLAYLIST_EXT": "{playlist}/{playlist_num}_{artist}_{song_name}",
    "OUTPUT_LIKED_SONGS": "Liked Songs/{artist}_{song_name}",
    "OUTPUT_SINGLE": "{artist}/{album}/{artist}_{song_name}",
    "OUTPUT_ALBUM": "{artist}/{album}/{album_num}_{artist}_{song_name}",
    "ROOT_PODCAST_PATH": "~/Music/Zotify Podcasts",
    "SPLIT_ALBUM_DISCS": "False",
    "MAX_FILENAME_LENGTH": "0",
    "BULK_WAIT_TIME": "1",
    "DOWNLOAD_REAL_TIME": "False",
    "TEMP_DOWNLOAD_DIR": "",
    "DOWNLOAD_PARENT_ALBUM": "False",
    "NO_COMPILATION_ALBUMS": "False",
    "REGEX_ENABLED": "False",
    "REGEX_TRACK_SKIP": "",
    "REGEX_EPISODE_SKIP": "",
    "REGEX_ALBUM_SKIP": "",
    "DOWNLOAD_FORMAT": "copy",
    "DOWNLOAD_QUALITY": "auto",
    "TRANSCODE_BITRATE": "auto",
    "SONG_ARCHIVE_LOCATION": "",
    "DISABLE_SONG_ARCHIVE": "False",
    "DISABLE_DIRECTORY_ARCHIVES": "False",
    "SKIP_EXISTING": "True",
    "SKIP_PREVIOUSLY_DOWNLOADED": "False",
    "EXPORT_M3U8": "False",
    "M3U8_LOCATION": "",
    "M3U8_REL_PATHS": "True",
    "LIKED_SONGS_ARCHIVE_M3U8": "True",
    "DOWNLOAD_LYRICS": "True",
    "LYRICS_LOCATION": "",
    "ALWAYS_CHECK_LYRICS": "False",
    "LYRICS_MD_HEADER": "False",
    "LANGUAGE": "en",
    "STRICT_LIBRARY_VERIFY": "True",
    "MD_DISC_TRACK_TOTALS": "True",
    "MD_SAVE_GENRES": "True",
    "MD_ALLGENRES": "False",
    "MD_GENREDELIMITER": ", ",
    "MD_ARTISTDELIMITER": ", ",
    "MD_SAVE_LYRICS": "True",
    "ALBUM_ART_JPG_FILE": "False",
    "RETRY_ATTEMPTS": "1",
    "CHUNK_SIZE": "20000",
    "REDIRECT_ADDRESS": "127.0.0.1",
    "PRINT_SPLASH": "False",
    "PRINT_PROGRESS_INFO": "True",
    "PRINT_SKIPS": "True",
    "PRINT_DOWNLOADS": "True",
    "PRINT_DOWNLOAD_PROGRESS": "True",
    "PRINT_URL_PROGRESS": "True",
    "PRINT_ALBUM_PROGRESS": "True",
    "PRINT_ARTIST_PROGRESS": "True",
    "PRINT_PLAYLIST_PROGRESS": "True",
    "PRINT_WARNINGS": "True",
    "PRINT_ERRORS": "True",
    "PRINT_API_ERRORS": "True",
    "FFMPEG_LOG_LEVEL": "error"
}

Additional Context

Originally created by @tcurdt on GitHub (Sep 18, 2025). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/82 Originally assigned to: @Googolplexed0 on GitHub. **Zotify Version** 2c2bb8d **Bug Description** After starting zotify it presents the auth url. This redirects back to the server running on 4381. But the server returns "empty response". Just cross-checking with `curl` ``` curl http://127.0.0.1:4381/login curl: (52) Empty reply from server ``` **Bug Triggering Command** **Error Traceback / Logs** Not sure where to find that. **Config File** ``` { "ROOT_PATH": "~/Music/Zotify Music", "SAVE_CREDENTIALS": "True", "CREDENTIALS_LOCATION": "", "OUTPUT": "", "OUTPUT_PLAYLIST": "{playlist}/{artist}_{song_name}", "OUTPUT_PLAYLIST_EXT": "{playlist}/{playlist_num}_{artist}_{song_name}", "OUTPUT_LIKED_SONGS": "Liked Songs/{artist}_{song_name}", "OUTPUT_SINGLE": "{artist}/{album}/{artist}_{song_name}", "OUTPUT_ALBUM": "{artist}/{album}/{album_num}_{artist}_{song_name}", "ROOT_PODCAST_PATH": "~/Music/Zotify Podcasts", "SPLIT_ALBUM_DISCS": "False", "MAX_FILENAME_LENGTH": "0", "BULK_WAIT_TIME": "1", "DOWNLOAD_REAL_TIME": "False", "TEMP_DOWNLOAD_DIR": "", "DOWNLOAD_PARENT_ALBUM": "False", "NO_COMPILATION_ALBUMS": "False", "REGEX_ENABLED": "False", "REGEX_TRACK_SKIP": "", "REGEX_EPISODE_SKIP": "", "REGEX_ALBUM_SKIP": "", "DOWNLOAD_FORMAT": "copy", "DOWNLOAD_QUALITY": "auto", "TRANSCODE_BITRATE": "auto", "SONG_ARCHIVE_LOCATION": "", "DISABLE_SONG_ARCHIVE": "False", "DISABLE_DIRECTORY_ARCHIVES": "False", "SKIP_EXISTING": "True", "SKIP_PREVIOUSLY_DOWNLOADED": "False", "EXPORT_M3U8": "False", "M3U8_LOCATION": "", "M3U8_REL_PATHS": "True", "LIKED_SONGS_ARCHIVE_M3U8": "True", "DOWNLOAD_LYRICS": "True", "LYRICS_LOCATION": "", "ALWAYS_CHECK_LYRICS": "False", "LYRICS_MD_HEADER": "False", "LANGUAGE": "en", "STRICT_LIBRARY_VERIFY": "True", "MD_DISC_TRACK_TOTALS": "True", "MD_SAVE_GENRES": "True", "MD_ALLGENRES": "False", "MD_GENREDELIMITER": ", ", "MD_ARTISTDELIMITER": ", ", "MD_SAVE_LYRICS": "True", "ALBUM_ART_JPG_FILE": "False", "RETRY_ATTEMPTS": "1", "CHUNK_SIZE": "20000", "REDIRECT_ADDRESS": "127.0.0.1", "PRINT_SPLASH": "False", "PRINT_PROGRESS_INFO": "True", "PRINT_SKIPS": "True", "PRINT_DOWNLOADS": "True", "PRINT_DOWNLOAD_PROGRESS": "True", "PRINT_URL_PROGRESS": "True", "PRINT_ALBUM_PROGRESS": "True", "PRINT_ARTIST_PROGRESS": "True", "PRINT_PLAYLIST_PROGRESS": "True", "PRINT_WARNINGS": "True", "PRINT_ERRORS": "True", "PRINT_API_ERRORS": "True", "FFMPEG_LOG_LEVEL": "error" } ``` **Additional Context**
kerem 2026-02-27 04:57:21 +03:00
Author
Owner

@Googolplexed0 commented on GitHub (Sep 24, 2025):

Going to need a bit more information to help troubleshoot. Are you saying that the authentication process is not working for you? Does your browser redirect successfully? Has a previous version's authentication worked for you previously?

Error Traceback / Logs

Not sure where to find that.

A debug log will appear if you run with the --debug command.

<!-- gh-comment-id:3326364812 --> @Googolplexed0 commented on GitHub (Sep 24, 2025): Going to need a bit more information to help troubleshoot. Are you saying that the authentication process is not working for you? Does your browser redirect successfully? Has a previous version's authentication worked for you previously? > **Error Traceback / Logs** > > Not sure where to find that. A debug log will appear if you run with the `--debug` command.
Author
Owner

@tcurdt commented on GitHub (Sep 24, 2025):

Are you saying that the authentication process is not working for you? Does your browser redirect successfully?

Correct. I open the URL in the browser. It redirects to localhost, but the auth does not complete.

http://127.0.0.1:4381/login?code=... gives an "empty response"

First I thought it was a docker problem but the server answer on the outside and on the inside of the container.

Has a previous version's authentication worked for you previously?

First time I tried zotify.

Error Traceback / Logs
Not sure where to find that.

A debug log will appear if you run with the --debug command.

INFO:root:OAuth: Visit in your browser and log in: https://accounts.spotify.com/authorize?response_type=code&client_id=[...snip...]&redirect_uri=http://127.0.0.1:4381/login&code_challenge=[...snip...]&code_challenge_method=S256&scope=app-remote-control+playlist-modify+playlist-modify-private+playlist-modify-public+playlist-read+playlist-read-collaborative+playlist-read-private+streaming+ugc-image-upload+user-follow-modify+user-follow-read+user-library-modify+user-library-read+user-modify+user-modify-playback-state+user-modify-private+user-personalized+user-read-birthdate+user-read-currently-playing+user-read-email+user-read-play-history+user-read-playback-position+user-read-playback-state+user-read-private+user-read-recently-played+user-top-read
INFO:root:OAuth: Waiting for callback on 127.0.0.1:4381

What ended working is to install curl in the container. Then copy the failed http://127.0.0.1:4381/login?code=A... url into the container and complete the auth like that. The response still is

curl: (1) Received HTTP/0.9 when not allowed

but weirdly enough now the auth request finished.

I think what would be helpful is to have http://127.0.0.1:4381/ return some kind of response.
I think zotify could even return a minimal html page that has the link that is printed for OAuth.

<!-- gh-comment-id:3327480901 --> @tcurdt commented on GitHub (Sep 24, 2025): > Are you saying that the authentication process is not working for you? Does your browser redirect successfully? Correct. I open the URL in the browser. It redirects to localhost, but the auth does not complete. `http://127.0.0.1:4381/login?code=...` gives an "empty response" First I thought it was a docker problem but the server answer on the outside and on the inside of the container. > Has a previous version's authentication worked for you previously? First time I tried zotify. > > **Error Traceback / Logs** > > Not sure where to find that. > > A debug log will appear if you run with the `--debug` command. ``` INFO:root:OAuth: Visit in your browser and log in: https://accounts.spotify.com/authorize?response_type=code&client_id=[...snip...]&redirect_uri=http://127.0.0.1:4381/login&code_challenge=[...snip...]&code_challenge_method=S256&scope=app-remote-control+playlist-modify+playlist-modify-private+playlist-modify-public+playlist-read+playlist-read-collaborative+playlist-read-private+streaming+ugc-image-upload+user-follow-modify+user-follow-read+user-library-modify+user-library-read+user-modify+user-modify-playback-state+user-modify-private+user-personalized+user-read-birthdate+user-read-currently-playing+user-read-email+user-read-play-history+user-read-playback-position+user-read-playback-state+user-read-private+user-read-recently-played+user-top-read INFO:root:OAuth: Waiting for callback on 127.0.0.1:4381 ``` What ended working is to install `curl` in the container. Then copy the failed `http://127.0.0.1:4381/login?code=A...` url into the container and complete the auth like that. The response still is `curl: (1) Received HTTP/0.9 when not allowed` but weirdly enough now the auth request finished. I think what would be helpful is to have `http://127.0.0.1:4381/` return some kind of response. I think `zotify` could even return a minimal html page that has the link that is printed for OAuth.
Author
Owner

@Googolplexed0 commented on GitHub (Oct 1, 2025):

First I thought it was a docker problem but the server answer on the outside and on the inside of the container.

Did you make sure that your docker run command had -p 4381:4381 included (as per README instructions)?

The response still is

curl: (1) Received HTTP/0.9 when not allowed

but weirdly enough now the auth request finished.

I think what would be helpful is to have http://127.0.0.1:4381/ return some kind of response. I think zotify could even return a minimal html page that has the link that is printed for OAuth.

Yes, the current implementation the OAuth server doesn't return a response so seeing an error in-browser is expected. Once the server receives your callback it shuts down and then continues with the necessary parsing steps. It would be a good addition to include a small response to acknowledge a successful callback. Not a high-priority addition though.

<!-- gh-comment-id:3354382671 --> @Googolplexed0 commented on GitHub (Oct 1, 2025): > First I thought it was a docker problem but the server answer on the outside and on the inside of the container. Did you make sure that your docker run command had `-p 4381:4381` included (as per `README` instructions)? > The response still is > > `curl: (1) Received HTTP/0.9 when not allowed` > > but weirdly enough now the auth request finished. > > I think what would be helpful is to have `http://127.0.0.1:4381/` return some kind of response. I think `zotify` could even return a minimal html page that has the link that is printed for OAuth. Yes, the current implementation the OAuth server doesn't return a response so seeing an error in-browser is expected. Once the server receives your callback it shuts down and then continues with the necessary parsing steps. It would be a good addition to include a small response to acknowledge a successful callback. Not a high-priority addition though.
Author
Owner

@tcurdt commented on GitHub (Oct 1, 2025):

First I thought it was a docker problem but the server answer on the outside and on the inside of the container.

Did you make sure that your docker run command had -p 4381:4381 included (as per README instructions)?

Certainly.

In fact, on macOS it needs to be -p 127.0.0.1:4381:4381 to grant access from the host.

The response still is
curl: (1) Received HTTP/0.9 when not allowed
but weirdly enough now the auth request finished.
I think what would be helpful is to have http://127.0.0.1:4381/ return some kind of response. I think zotify could even return a minimal html page that has the link that is printed for OAuth.

Yes, the current implementation the OAuth server doesn't return a response so seeing an error in-browser is expected. Once the server receives your callback it shuts down and then continues with the necessary parsing steps.

I see. But somehow this did not fully work for me from the browser. Only the curl worked.
Not sure I understand the difference. But maybe the current approach is just a tiny bit too minimalistic.

It would be a good addition to include a small response to acknowledge a successful callback. Not a high-priority addition though.

I would go even one stop further: Provide the OAuth link via minimal HTML page on http://127.0.0.1:4381
But as you said - also just a nice to have.

I found my workaround and the credentials are saved.
So up to you if you want to keep the issue open for tracking the improvement or not.

Thanks for the help.

<!-- gh-comment-id:3355573406 --> @tcurdt commented on GitHub (Oct 1, 2025): > > First I thought it was a docker problem but the server answer on the outside and on the inside of the container. > > Did you make sure that your docker run command had `-p 4381:4381` included (as per `README` instructions)? Certainly. In fact, on macOS it needs to be `-p 127.0.0.1:4381:4381` to grant access from the host. > > The response still is > > `curl: (1) Received HTTP/0.9 when not allowed` > > but weirdly enough now the auth request finished. > > I think what would be helpful is to have `http://127.0.0.1:4381/` return some kind of response. I think `zotify` could even return a minimal html page that has the link that is printed for OAuth. > > Yes, the current implementation the OAuth server doesn't return a response so seeing an error in-browser is expected. Once the server receives your callback it shuts down and then continues with the necessary parsing steps. I see. But somehow this did not fully work for me from the browser. Only the curl worked. Not sure I understand the difference. But maybe the current approach is just a tiny bit too minimalistic. > It would be a good addition to include a small response to acknowledge a successful callback. Not a high-priority addition though. I would go even one stop further: Provide the OAuth link via minimal HTML page on http://127.0.0.1:4381 But as you said - also just a nice to have. I found my workaround and the credentials are saved. So up to you if you want to keep the issue open for tracking the improvement or not. Thanks for the help.
Author
Owner

@Googolplexed0 commented on GitHub (Nov 11, 2025):

See https://github.com/kokarare1212/librespot-python/pull/323

<!-- gh-comment-id:3514965905 --> @Googolplexed0 commented on GitHub (Nov 11, 2025): See https://github.com/kokarare1212/librespot-python/pull/323
Author
Owner

@Googolplexed0 commented on GitHub (Nov 17, 2025):

See kokarare1212/librespot-python#323

PR#323 implemented.

<!-- gh-comment-id:3539723805 --> @Googolplexed0 commented on GitHub (Nov 17, 2025): > See [kokarare1212/librespot-python#323](https://github.com/kokarare1212/librespot-python/pull/323) PR#323 implemented.
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/zotify#72
No description provided.