Closed lor74 closed 8 months ago
Where did you get that uri concept from?
Using mass.search. I have an input_text with some artists and cycle on it to get the URI artist in prefer to start the mass.play_media with radio mode ON
- service: mass.search
data:
limit: 1
name: "{{ states('input_select.ma_artist_radio_shuffle') }}"
media_type:
- artist
response_variable: uri_result
I would check to see if perhaps mass.search is returning an invalid result?
Although the url in the error looks odd.
Although the url in the error looks odd.
Since it appears random… could be a provider error?
I have seen these errors in b82 as well while MA was idle for days. I configured only Spotify and radio as providers
Weird as I have Spotify as well but I haven’t seen this….?
@erkr did you notice if the error appears after new token retrieve?
2024-01-17 18:08:08.280 DEBUG (MainThread) [music_assistant.providers.spotify] Retrieved Spotify token using librespot in 0.76 seconds
2024-01-17 18:08:08.280 INFO (MainThread) [music_assistant.providers.spotify] Successfully logged in to Spotify as xxxxxx-yy
Didn't see them in b83 (yet)
Same here. … but if something related to Spotify could no be significative. we will see in the next days.
Appear right now… and also it seems there are more info (HTTP 502 - Bad Gateway)
`2024-01-22 15:40:36.924 ERROR (MainThread) [music_assistant.providers.qobuz] Error while processing track/getFileUrl:
Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/qobuz/init.py", line 690, in _get_data result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1165, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('http://www.qobuz.com/api.json/0.2/track/getFileUrl?format_id=27&track_id=3357759&intent=stream&request_ts=1705934430.1896796&request_sig=d902325ead2ecb73208255a1f4e580c9&app_id=942852567&user_auth_token=TFxFPdR2XG71ocjOUqPHqoVFusLacL4LrFuJMx4Q0nT7tK22fqLCQ9aCi-eqoIBmbAioWyWW6DH23fDMvKx6Zw') 2024-01-22 15:40:36.980 ERROR (MainThread) [music_assistant.providers.qobuz] Error while processing track/getFileUrl:
Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/qobuz/init.py", line 690, in _get_data result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1165, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('http://www.qobuz.com/api.json/0.2/track/getFileUrl?format_id=7&track_id=3357759&intent=stream&request_ts=1705934436.9254446&request_sig=696484ec2f3f0efb547c280ee73c5ab0&app_id=942852567&user_auth_token=TFxFPdR2XG71ocjOUqPHqoVFusLacL4LrFuJMx4Q0nT7tK22fqLCQ9aCi-eqoIBmbAioWyWW6DH23fDMvKx6Zw') 2024-01-22 15:40:37.033 ERROR (MainThread) [music_assistant.providers.qobuz] Error while processing track/getFileUrl:
Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/qobuz/init.py", line 690, in _get_data result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1165, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('http://www.qobuz.com/api.json/0.2/track/getFileUrl?format_id=6&track_id=3357759&intent=stream&request_ts=1705934436.981313&request_sig=d3478bd458b3af7f1ed7e5c86ec840a9&app_id=942852567&user_auth_token=TFxFPdR2XG71ocjOUqPHqoVFusLacL4LrFuJMx4Q0nT7tK22fqLCQ9aCi-eqoIBmbAioWyWW6DH23fDMvKx6Zw') 2024-01-22 15:40:37.089 ERROR (MainThread) [music_assistant.providers.qobuz] Error while processing track/getFileUrl:
Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/qobuz/init.py", line 690, in _get_data result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1165, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('http://www.qobuz.com/api.json/0.2/track/getFileUrl?format_id=5&track_id=3357759&intent=stream&request_ts=1705934437.034591&request_sig=9a477fea15954f80dec70d56d1330a5f&app_id=942852567&user_auth_token=TFxFPdR2XG71ocjOUqPHqoVFusLacL4LrFuJMx4Q0nT7tK22fqLCQ9aCi-eqoIBmbAioWyWW6DH23fDMvKx6Zw') 2024-01-22 15:40:37.141 ERROR (MainThread) [music_assistant.providers.qobuz] Error while processing track/getFileUrl:
Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/qobuz/init.py", line 690, in _get_data result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1165, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('http://www.qobuz.com/api.json/0.2/track/getFileUrl?format_id=27&track_id=67678737&intent=stream&request_ts=1705934437.0897949&request_sig=f9b9b1b79434c400a6ef69049d943cb3&app_id=942852567&user_auth_token=TFxFPdR2XG71ocjOUqPHqoVFusLacL4LrFuJMx4Q0nT7tK22fqLCQ9aCi-eqoIBmbAioWyWW6DH23fDMvKx6Zw') 2024-01-22 15:40:37.987 ERROR (MainThread) [music_assistant.providers.qobuz] Error while processing track/getFileUrl:
Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/qobuz/init.py", line 690, in _get_data result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1165, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('http://www.qobuz.com/api.json/0.2/track/getFileUrl?format_id=7&track_id=67678737&intent=stream&request_ts=1705934437.1425288&request_sig=480838e055a03fecdc956f04c0450e64&app_id=942852567&user_auth_token=TFxFPdR2XG71ocjOUqPHqoVFusLacL4LrFuJMx4Q0nT7tK22fqLCQ9aCi-eqoIBmbAioWyWW6DH23fDMvKx6Zw') 2024-01-22 15:40:38.049 ERROR (MainThread) [music_assistant.providers.qobuz] Error while processing track/getFileUrl:
Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/qobuz/init.py", line 690, in _get_data result = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1165, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('http://www.qobuz.com/api.json/0.2/track/getFileUrl?format_id=6&track_id=67678737&intent=stream&request_ts=1705934437.9878457&request_sig=47da0ac7635386c490bed2d7be6c227b&app_id=942852567&user_auth_token=TFxFPdR2XG71ocjOUqPHqoVFusLacL4LrFuJMx4Q0nT7tK22fqLCQ9aCi-eqoIBmbAioWyWW6DH23fDMvKx6Zw') `
That is totally different as that is to do with qobuz. Please try and keep followup on your original report.
Ok I didn't notice it's quobuz... I have checked the logs because playback was stopped using the same maas.search service reported above.
Are you playing back to a chromecast group?
no I am playing to an Apple Airport device
How it works radio mode? because maybe the URI could be a QUOBUZ URI when mass.search query for artist name.
Ok I will close this issue as it seems to be fixed. If you have issues with Qobuz playing to an Airplay device then please raise a separate issue.
How it works radio mode?
I’m not sure as it is music provider specific.
Id say your media_type is wrong as well if you are passing an artist name
It's possible to "force" to use just one provider in mass.search? maybe mass.search retrieve an URI from quobuz and could ask to spotify and viceversa?
No you can’t. Do you even need to do the search first? Why not just call for the artist to be played? If you want to keep doing it the way you are then note that complex URIs are no longer required. You could just pass “artistName - trackName”
edit: so make sure you are passing a valid URI
I search for artist name (taken from an input text)
- service: mass.search
data:
limit: 1
name: "{{ states('input_select.ma_artist_radio_shuffle') }}"
media_type:
- artist
response_variable: uri_result
And then pass the URI to mass.play
- service: mass.play_media
target:
device_id: e325948e0c54ba0b8ea12bbc6d11b162
data:
media_type: playlist
media_id: "{{ uri_result.artists[0]['uri'] }}"
radio_mode: "on"
enqueue: replace
So I guess the URI is valid since is retrieved by mass.search. I have spotivy and quobuz provider... could this a problem?
EDIT: The problem appears after the radio playlist was started... for example after 10 minutes...
Yes but there is an assumption that your code does pull the url correctly. I just wondered that. But I still don’t know why you aren’t just doing something like
service: mass.play_media
target:
device_id: e325948e0c54ba0b8ea12bbc6d11b162
data:
media_type: artist
media_id: "{{ states('input_select.ma_artist_radio_shuffle') }}"
radio_mode: "on"
enqueue: replace
Ah ok because simply I haven't understand that I can pass Artist Name as media_id :) I will change the script accordingly.... and let yoy know if the problem still appear.
Thanks
Hi with the new version seems that radio modo is no working. I am going tp open a different issue for this.
What version of Music Assistant has the issue?
2.0.0b82
The problem
Randomically Music Assistant stop playing a playlist with radio mode on. Checking the logs I have found an error very similar (I guess) to this old issue https://github.com/music-assistant/hass-music-assistant/issues/486
How to reproduce
Appears randomically. Using service mass.play_media for genereate a playlist from an URI with radio mode on.
Relevant log output
Additional information
No response
What version of Home Assistant Core are your running
2024.1.3
What type of installation are you running?
Home Assistant OS
On what type of hardware are you running?
Raspberry Pi