if self._use_ssl:
url = "https://%s/api/%s" % (self._host, endpoint)
headers = {"Authorization": "Bearer %s" % self._token, "Content-Type": "application/json"}
- async with self.http_session.get(url, headers=headers) as response:
+ async with self.http_session.get(url, headers=headers, verify_ssl=False) as response:
return await response.json()
async def __post_data(self, endpoint, data):
if self._use_ssl:
url = "https://%s/api/%s" % (self._host, endpoint)
headers = {"Authorization": "Bearer %s" % self._token, "Content-Type": "application/json"}
- async with self.http_session.post(url, headers=headers, json=data) as response:
+ async with self.http_session.post(url, headers=headers, json=data, verify_ssl=False) as response:
return await response.json()
\ No newline at end of file
LOGGER.debug('Start analyzing track %s' % item_key)
if streamdetails['type'] == 'url':
async with aiohttp.ClientSession() as session:
- async with session.get(streamdetails["path"]) as resp:
+ async with session.get(streamdetails["path"], verify_ssl=False) as resp:
audio_data = await resp.read()
elif streamdetails['type'] == 'executable':
process = await asyncio.create_subprocess_shell(streamdetails["path"],
headers = {'User-Agent': 'Music Assistant/1.0.0 https://github.com/marcelveldt'}
params['fmt'] = 'json'
async with self.throttler:
- async with self.http_session.get(url, headers=headers, params=params) as response:
+ async with self.http_session.get(url, headers=headers, params=params, verify_ssl=False) as response:
try:
result = await response.json()
except Exception as exc:
url = 'http://webservice.fanart.tv/v3/%s' % endpoint
params['api_key'] = '639191cb0774661597f28a47e7e2bad5'
async with self.throttler:
- async with self.http_session.get(url, params=params) as response:
+ async with self.http_session.get(url, params=params, verify_ssl=False) as response:
result = await response.json()
if 'error' in result and 'limit' in result['error']:
raise Exception(result['error'])
params["user_auth_token"] = await self.__auth_token()
try:
async with self.throttler:
- async with self.http_session.get(url, headers=headers, params=params) as response:
+ async with self.http_session.get(url, headers=headers, params=params, verify_ssl=False) as response:
result = await response.json()
if not result or 'error' in result:
LOGGER.error(url)
token = await self.get_token()
headers = {'Authorization': 'Bearer %s' % token["accessToken"]}
async with self.throttler:
- async with self.http_session.get(url, headers=headers, params=params) as response:
+ async with self.http_session.get(url, headers=headers, params=params, verify_ssl=False) as response:
result = await response.json()
if not result or 'error' in result:
LOGGER.error(url)
only support for basic commands
'''
data = await request.json()
- LOGGER.info("jsonrpc: %s" % data)
+ LOGGER.debug("jsonrpc: %s" % data)
params = data['params']
player_id = params[0]
cmds = params[1]
cmd_str = " ".join(cmds)
- if cmd_str in ['play', 'pause', 'stop']:
- await self.mass.player.player_command(player_id, cmd_str)
+ player = await self.mass.player.get_player(player_id)
+ if cmd_str == 'play':
+ await player.play()
+ elif cmd_str == 'pause':
+ await player.pause()
+ elif cmd_str == 'stop':
+ await player.stop()
+ elif cmd_str == 'next':
+ await player.next()
+ elif cmd_str == 'previous':
+ await player.previous()
elif 'power' in cmd_str:
args = cmds[1] if len(cmds) > 1 else None
await self.mass.player.player_command(player_id, cmd_str, args)