musikcube
musikcube copied to clipboard
Playback from VLC using HTTP basic authentication failing
- Set a password for musikcube, under
Server Setup
- Trying to connect VLC to musikcube port
7906
using HTTP basic authentication - The following message keeps repeating in the VLC console
[000002537814b6e0] access stream error: HTTP 401 error
[000002537814b6e0] http stream error: authentication failed without realm
[000002537814b860] access stream error: HTTP 401 error
[000002537814b860] http stream error: authentication failed without realm
[000002537814b860] access stream error: HTTP 401 error
Any ideas on how to work around this?
Seeing the same issue with a fresh dev build, both using VLC as well as manually making GET requests to it. Would be nice to see it looked into.
Out of curiosity, how are you obtaining track URLs for playback within VLC? And how are you setting the auth header? I don't see any options for that in the VLC UI. If you can give me more details I can try to repro on my end.
You can also set the environment variable MUSIKCUBE_DISABLE_HTTP_SERVER_AUTH=1
to disable HTTP auth if you wish.
I just now realized the title of this issue is about playback; I was using VLC to load album art from musikcube.
Regardless, when it comes to the HTTP Basic Auth: no matter what password I send to musikcube, it always returns a 401 Unauthorized. I'm using Python for my tests and can confirm it is sending the header correctly:
from requests import get
print(requests.get("http://localhost:7905/thumbnail/id", auth = ("default", "")))
# returns 'unauthorized' despite having no password set
# doing the same code but using a password yeilds no difference
Yes, the server had no password set. This also occurs if I set the password to something as simple as 'abc'. I just cannot get http auth to work.
Edit: currently on mobile, will continue testing tomorrow on PC
Hmm, this seems to work for me:
> python3
Python 3.10.7 (main, Nov 24 2022, 19:45:47) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from requests import get
>>> print(get("http://192.168.1.221:7906/thumbnail/908", auth = ("default", "776655")))
<Response [200]>
One thing to note is that your sample is using port 7905
, but this is the websocket server. The HTTP server runs on port 7906
-- perhaps this is your issue?
I'm using port 7906 for thumbnails, I guess I put a typo in my example.
Yesterday I was always getting a 401, today it seems to give me a "Remote end closed connection" when I actually get the password right now.
Assuming that Musikcube returns a 404 on an unexisting thumbnail?
Nevermind, Musikcube closes the connection for thumbnails that don't exist. I was expecting a 404.