skip ssl verification
authormarcelveldt <marcelvanderveldt@MacBook-Silvia.local>
Sun, 13 Oct 2019 22:55:24 +0000 (00:55 +0200)
committermarcelveldt <marcelvanderveldt@MacBook-Silvia.local>
Sun, 13 Oct 2019 22:55:24 +0000 (00:55 +0200)
music_assistant/homeassistant.py
music_assistant/http_streamer.py
music_assistant/metadata.py
music_assistant/musicproviders/qobuz.py
music_assistant/musicproviders/spotify.py
music_assistant/web.py

index dae0feb333caa46041d5f41e89ad36dd29583cfc..3b884425c9ba4ee26d8036c47a8871e012971c99 100644 (file)
@@ -292,7 +292,7 @@ class HomeAssistant():
         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):
@@ -301,5 +301,5 @@ class HomeAssistant():
         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
index 966eb207b238d0af5d6d1dca58ff8c12651f809d..5335cec5a3ea5af08e769344551d585a1a04b570 100755 (executable)
@@ -387,7 +387,7 @@ class HTTPStreamer():
             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"],
index 6863f9f741c20b55ce93f42db637495a831567cc..103c73df5a4b04bb70bc023b79f28e0f1085262b 100755 (executable)
@@ -127,7 +127,7 @@ class MusicBrainz():
         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:
@@ -177,7 +177,7 @@ class FanartTv():
         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'])
index ac0448fd3e5c1d6e3b82f9b63aefb0e74a5b4c97..085d3a32d3f0cd2faef2df1897a6bf929c0d402d 100644 (file)
@@ -538,7 +538,7 @@ class QobuzProvider(MusicProvider):
             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)
index c284f21d1f1f3b0350d347e26f58bcef66a9c83b..9bc99f76001aefeb9cf1587d03900869d7e113f3 100644 (file)
@@ -477,7 +477,7 @@ class SpotifyProvider(MusicProvider):
         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)
index 83bac0639146c228465269ccd32f31fdc2997850..d3533fdb09a90c7b8dbf9a590c3c2d22c4653949 100755 (executable)
@@ -341,13 +341,22 @@ class Web():
             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)