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

500 error from terminal, but 200 from browser #24

Open
mbecker4 opened this issue Oct 13, 2021 · 4 comments
Open

500 error from terminal, but 200 from browser #24

mbecker4 opened this issue Oct 13, 2021 · 4 comments

Comments

@mbecker4
Copy link

I'm hitting the endpoint on my raspberry pi with python trying to play a song in the living room with the following:

r = requests.get('http://localhost:5005/Living%20Room/applemusic/now/album:370090822')

When running in terminal I get a 500 {"status":"error"}

However when I copy the exact url and paste it into a browser it works and I get {"status":"success"}

I am still relatively new to python so I'm hoping I didn't overlook something obvious. But any clarification on why this would be happening would be much appreciated.

@hankhank10
Copy link
Owner

hankhank10 commented Oct 13, 2021 via email

@mbecker4
Copy link
Author

After some additional troubleshooting I rebooted everything. Unplugged/and replugged in the Sonos, rebooted my wifi, and rebooted the raspberry pi. I am able to now hit 'http://localhost:5005/zones and get the proper response but when I try to play any music I am now getting this 500 error

{"status":"error","error":"Got status 500 when invoking /MediaRenderer/AVTransport/Control","stack":"Error: Got status 500 when invoking /MediaRenderer/AVTransport/Control\n at Object.invoke (/home/pi/node-sonos-http-api/node_modules/sonos-discovery/lib/helpers/soap.js:99:10)\n at Player.addURIToQueue (/home/pi/node-sonos-http-api/node_modules/sonos-discovery/lib/models/Player.js:616:15)\n at /home/pi/node-sonos-http-api/lib/actions/appleMusic.js:55:50\n at processTicksAndRejections (node:internal/process/task_queues:94:5)"}

@hankhank10
Copy link
Owner

hankhank10 commented Oct 13, 2021 via email

@mbecker4
Copy link
Author

Okay, I ran down that trail and did a ton of troubleshooting it seems the problem is with the

r = requests.get(urltoget)
which tracing back I found it was a problem with the sonosinstructions
tracing that back I found that the problem is with the receivedtext[11:]

if I do r=requests.get(user settings.sonoshttpaddress + '/' + sonosroom_local + '/applemusic/now/album:370090822')
it works flawlessly.

I've attempted trying making a new variable to isolate just the album id and double check that it is a string but that didn't work either.

Is there anything else that I should be doing to get that id to play nice? or is this also being caused by node-sones-http-api?

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

2 participants