music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.32k stars 48 forks source link

Attempt to decode JSON with unexpected mimetype - music_assistant.providers.spotify #1795

Closed lor74 closed 8 months ago

lor74 commented 8 months ago

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.

        - service: mass.play_media
          target:
            device_id: e325948e0c54ba0b8ea12bbc6d11b162
          data:
            media_type: playlist
            media_id: "{{ uri_result.artists[0]['uri'] }}"
            radio_mode: "on"
            enqueue: replace

Relevant log output

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
2024-01-17 18:08:08.403 ERROR (MainThread) [music_assistant.providers.spotify] tracks/5LeDMHIZ5YDZ2b1VOcYVcG - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/5LeDMHIZ5YDZ2b1VOcYVcG?market=from_token&country=from_token')
2024-01-17 18:08:08.403 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/5LeDMHIZ5YDZ2b1VOcYVcG took 0.12 seconds
2024-01-17 18:08:08.465 ERROR (MainThread) [music_assistant.providers.spotify] tracks/1I3cmZZmhxGvL2QViQC17h - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/1I3cmZZmhxGvL2QViQC17h?market=from_token&country=from_token')
2024-01-17 18:08:08.465 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/1I3cmZZmhxGvL2QViQC17h took 0.05 seconds
2024-01-17 18:08:08.617 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/2Rn7bVL1FVYboc4c55RUdg took 0.1 seconds
2024-01-17 18:08:08.716 ERROR (MainThread) [music_assistant.providers.spotify] tracks/2Rn7bVL1FVYboc4c55RUdg - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/2Rn7bVL1FVYboc4c55RUdg?market=from_token&country=from_token')
2024-01-17 18:08:08.717 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/2Rn7bVL1FVYboc4c55RUdg took 0.05 seconds
2024-01-17 18:08:08.717 WARNING (MainThread) [music_assistant.audio] Item 2Rn7bVL1FVYboc4c55RUdg not found
2024-01-17 18:08:08.813 ERROR (MainThread) [music_assistant.providers.spotify] tracks/43h4FonpCeaaURpFpiQsf9 - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/43h4FonpCeaaURpFpiQsf9?market=from_token&country=from_token')
2024-01-17 18:08:08.814 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/43h4FonpCeaaURpFpiQsf9 took 0.05 seconds
2024-01-17 18:08:08.928 ERROR (MainThread) [music_assistant.providers.spotify] tracks/7G67ZJRQT9nn2Fa9vA6B32 - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/7G67ZJRQT9nn2Fa9vA6B32?market=from_token&country=from_token')
2024-01-17 18:08:08.928 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/7G67ZJRQT9nn2Fa9vA6B32 took 0.05 seconds
2024-01-17 18:08:09.032 ERROR (MainThread) [music_assistant.providers.spotify] tracks/6gXrEUzibufX9xYPk3HD5p - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/6gXrEUzibufX9xYPk3HD5p?market=from_token&country=from_token')
2024-01-17 18:08:09.033 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/6gXrEUzibufX9xYPk3HD5p took 0.05 seconds
2024-01-17 18:08:09.033 WARNING (MainThread) [music_assistant.audio] Item 6gXrEUzibufX9xYPk3HD5p not found
2024-01-17 18:08:09.169 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/artists/0ECwFtbIWEVNwjlrfc6xoL took 0.09 seconds
2024-01-17 18:08:09.230 ERROR (MainThread) [music_assistant.providers.spotify] tracks/5ynO8cYFjDwELIZfFHHeYe - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/5ynO8cYFjDwELIZfFHHeYe?market=from_token&country=from_token')
2024-01-17 18:08:09.230 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/5ynO8cYFjDwELIZfFHHeYe took 0.05 seconds
2024-01-17 18:08:09.335 ERROR (MainThread) [music_assistant.providers.spotify] artists/0ECwFtbIWEVNwjlrfc6xoL/albums?include_groups=album,single,compilation - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/artists/0ECwFtbIWEVNwjlrfc6xoL/albums?include_groups=album,single,compilation&limit=50&offset=0&market=from_token&country=from_token')
2024-01-17 18:08:09.335 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/artists/0ECwFtbIWEVNwjlrfc6xoL/albums?include_groups=album,single,compilation took 0.05 seconds
2024-01-17 18:08:09.443 ERROR (MainThread) [music_assistant.providers.spotify] tracks/7fRvtXvJMpGfTLdF0M09a1 - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/7fRvtXvJMpGfTLdF0M09a1?market=from_token&country=from_token')
2024-01-17 18:08:09.443 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/7fRvtXvJMpGfTLdF0M09a1 took 0.05 seconds
2024-01-17 18:08:09.443 WARNING (MainThread) [music_assistant.audio] Item 7fRvtXvJMpGfTLdF0M09a1 not found
2024-01-17 18:08:09.549 ERROR (MainThread) [music_assistant.providers.spotify] tracks/4W4wYHtsrgDiivRASVOINL - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/4W4wYHtsrgDiivRASVOINL?market=from_token&country=from_token')
2024-01-17 18:08:09.549 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/4W4wYHtsrgDiivRASVOINL took 0.05 seconds
2024-01-17 18:08:09.676 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/0PdM2a6oIjqepoEfcJo0RO took 0.08 seconds
2024-01-17 18:08:09.755 ERROR (MainThread) [music_assistant.providers.spotify] artists/0ECwFtbIWEVNwjlrfc6xoL - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/artists/0ECwFtbIWEVNwjlrfc6xoL?market=from_token&country=from_token')
2024-01-17 18:08:09.755 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/artists/0ECwFtbIWEVNwjlrfc6xoL took 0.05 seconds
2024-01-17 18:08:09.851 ERROR (MainThread) [music_assistant.providers.spotify] tracks/0PdM2a6oIjqepoEfcJo0RO - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/0PdM2a6oIjqepoEfcJo0RO?market=from_token&country=from_token')
2024-01-17 18:08:09.852 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/0PdM2a6oIjqepoEfcJo0RO took 0.05 seconds
2024-01-17 18:08:09.852 WARNING (MainThread) [music_assistant.audio] Item 0PdM2a6oIjqepoEfcJo0RO not found
2024-01-17 18:08:10.028 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/artists/0ECwFtbIWEVNwjlrfc6xoL/top-tracks took 0.12 seconds
2024-01-17 18:08:10.108 ERROR (MainThread) [music_assistant.providers.spotify] tracks/2oSpQ7QtIKTNFfA08Cy0ku - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/2oSpQ7QtIKTNFfA08Cy0ku?market=from_token&country=from_token')
2024-01-17 18:08:10.109 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/2oSpQ7QtIKTNFfA08Cy0ku took 0.09 seconds
2024-01-17 18:08:10.109 WARNING (MainThread) [music_assistant.audio] Item 2oSpQ7QtIKTNFfA08Cy0ku not found
2024-01-17 18:08:10.188 ERROR (MainThread) [music_assistant.providers.spotify] tracks/39qYD4J4BKvZMQgxfXl5bv - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/39qYD4J4BKvZMQgxfXl5bv?market=from_token&country=from_token')
2024-01-17 18:08:10.188 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/39qYD4J4BKvZMQgxfXl5bv took 0.06 seconds
2024-01-17 18:08:10.188 WARNING (MainThread) [music_assistant.audio] Item 39qYD4J4BKvZMQgxfXl5bv not found
2024-01-17 18:08:10.287 ERROR (MainThread) [music_assistant.providers.spotify] tracks/4EFkvOhgAmlHEfDfvfSoh5 - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/4EFkvOhgAmlHEfDfvfSoh5?market=from_token&country=from_token')
2024-01-17 18:08:10.287 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/4EFkvOhgAmlHEfDfvfSoh5 took 0.05 seconds
2024-01-17 18:08:10.287 WARNING (MainThread) [music_assistant.audio] Item 4EFkvOhgAmlHEfDfvfSoh5 not found
2024-01-17 18:08:10.384 ERROR (MainThread) [music_assistant.providers.spotify] tracks/7dH1uyeLjl0OHWjaJ1GC5k - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/7dH1uyeLjl0OHWjaJ1GC5k?market=from_token&country=from_token')
2024-01-17 18:08:10.384 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/7dH1uyeLjl0OHWjaJ1GC5k took 0.05 seconds
2024-01-17 18:08:10.388 DEBUG (MainThread) [music_assistant.providers.slimproto.cli] Handling CLI-request (player: aa:aa:fb:39:1a:2c command: status - args: ['-', 2] - kwargs: {'tags': 'xcfldatgrKN'})
2024-01-17 18:08:10.391 DEBUG (MainThread) [music_assistant.providers.slimproto.cli] Handling CLI-request (player: aa:aa:fb:39:1a:2c command: time - args: ['?'] - kwargs: {})
2024-01-17 18:08:10.486 ERROR (MainThread) [music_assistant.providers.spotify] tracks/0L0T4tMAaGqLgIVj1MOj9t - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/0L0T4tMAaGqLgIVj1MOj9t?market=from_token&country=from_token')
2024-01-17 18:08:10.486 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/0L0T4tMAaGqLgIVj1MOj9t took 0.04 seconds
2024-01-17 18:08:10.599 ERROR (MainThread) [music_assistant.providers.spotify] tracks/5K3Q1gue9nWLLwh6bYQFoB - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/5K3Q1gue9nWLLwh6bYQFoB?market=from_token&country=from_token')
2024-01-17 18:08:10.599 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/5K3Q1gue9nWLLwh6bYQFoB took 0.05 seconds
2024-01-17 18:08:10.702 ERROR (MainThread) [music_assistant.providers.spotify] tracks/47M6M8qE0brSeu2dvQP36r - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/47M6M8qE0brSeu2dvQP36r?market=from_token&country=from_token')
2024-01-17 18:08:10.702 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/47M6M8qE0brSeu2dvQP36r took 0.05 seconds
2024-01-17 18:08:10.804 ERROR (MainThread) [music_assistant.providers.spotify] tracks/2gQaQUhDCNGfBVXTvxAmXQ - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/2gQaQUhDCNGfBVXTvxAmXQ?market=from_token&country=from_token')
2024-01-17 18:08:10.804 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/2gQaQUhDCNGfBVXTvxAmXQ took 0.05 seconds
2024-01-17 18:08:10.804 WARNING (MainThread) [music_assistant.audio] Item 2gQaQUhDCNGfBVXTvxAmXQ not found
2024-01-17 18:08:10.954 ERROR (MainThread) [music_assistant.providers.spotify] tracks/1Tr4K5MU5XYE44umXGDndd - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/1Tr4K5MU5XYE44umXGDndd?market=from_token&country=from_token')
2024-01-17 18:08:10.954 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/1Tr4K5MU5XYE44umXGDndd took 0.1 seconds
2024-01-17 18:08:10.954 WARNING (MainThread) [music_assistant.audio] Item 1Tr4K5MU5XYE44umXGDndd not found
2024-01-17 18:08:11.043 ERROR (MainThread) [music_assistant.providers.spotify] tracks/2uynnXFdf3wBIjOEHCB9up - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/2uynnXFdf3wBIjOEHCB9up?market=from_token&country=from_token')
2024-01-17 18:08:11.043 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/2uynnXFdf3wBIjOEHCB9up took 0.05 seconds
2024-01-17 18:08:11.141 ERROR (MainThread) [music_assistant.providers.spotify] tracks/0yfNXxlyXdmP0ue1iJijx1 - 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api.spotify.com/v1/tracks/0yfNXxlyXdmP0ue1iJijx1?market=from_token&country=from_token')
2024-01-17 18:08:11.141 DEBUG (MainThread) [music_assistant.providers.spotify] Processing GET/tracks/0yfNXxlyXdmP0ue1iJijx1 took 0.05 seconds
2024-01-17 18:08:11.141 WARNING (MainThread) [music_assistant.audio] Item 0yfNXxlyXdmP0ue1iJijx1 not found

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

OzGav commented 8 months ago

Where did you get that uri concept from?

lor74 commented 8 months ago

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
OzGav commented 8 months ago

I would check to see if perhaps mass.search is returning an invalid result?

OzGav commented 8 months ago

Although the url in the error looks odd.

lor74 commented 8 months ago

Although the url in the error looks odd.

Since it appears random… could be a provider error?

erkr commented 8 months ago

I have seen these errors in b82 as well while MA was idle for days. I configured only Spotify and radio as providers

OzGav commented 8 months ago

Weird as I have Spotify as well but I haven’t seen this….?

lor74 commented 8 months ago

@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
erkr commented 8 months ago

Didn't see them in b83 (yet)

lor74 commented 8 months ago

Same here. … but if something related to Spotify could no be significative. we will see in the next days.

lor74 commented 8 months ago

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:

502 Bad Gateway

502 Bad Gateway


nginx

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:

502 Bad Gateway

502 Bad Gateway


nginx

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:

502 Bad Gateway

502 Bad Gateway


nginx

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:

502 Bad Gateway

502 Bad Gateway


nginx

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:

502 Bad Gateway

502 Bad Gateway


nginx

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:

502 Bad Gateway

502 Bad Gateway


nginx

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:

502 Bad Gateway

502 Bad Gateway


nginx

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') `

OzGav commented 8 months ago

That is totally different as that is to do with qobuz. Please try and keep followup on your original report.

lor74 commented 8 months ago

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.

OzGav commented 8 months ago

Are you playing back to a chromecast group?

lor74 commented 8 months ago

no I am playing to an Apple Airport device

lor74 commented 8 months ago

How it works radio mode? because maybe the URI could be a QUOBUZ URI when mass.search query for artist name.

OzGav commented 8 months ago

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.

OzGav commented 8 months ago

How it works radio mode?

I’m not sure as it is music provider specific.

OzGav commented 8 months ago

Id say your media_type is wrong as well if you are passing an artist name

lor74 commented 8 months ago

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?

OzGav commented 8 months ago

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

lor74 commented 8 months ago

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...

OzGav commented 8 months ago

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
lor74 commented 8 months ago

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

lor74 commented 8 months ago

Hi with the new version seems that radio modo is no working. I am going tp open a different issue for this.