Update qobuz.py
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 10 Jun 2019 19:05:03 +0000 (21:05 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 10 Jun 2019 19:05:03 +0000 (21:05 +0200)
music_assistant/modules/musicproviders/qobuz.py

index 798670af5ed1f6916d45bfc387ce0be8ce6ca041..95893475c8b417338fb8977648a5e96d50c0e5b4 100644 (file)
@@ -268,11 +268,8 @@ class QobuzProvider(MusicProvider):
         try:
             async with aiohttp.ClientSession(loop=asyncio.get_event_loop(), connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
                 async with session.get(streamdetails['url']) as resp:
-                    while True:
-                        chunk = await resp.content.read(64000)
-                        yield chunk
-                        if not chunk:
-                            break
+                    async for data, end_of_http_chunk in resp.content.iter_chunks():
+                        yield data
         except Exception as exc:
             LOGGER.exception(exc)