refactoring

This commit is contained in:
Devaev Maxim
2020-05-18 13:34:23 +03:00
parent 3947640771
commit 028e0b06ff
10 changed files with 110 additions and 132 deletions

View File

@@ -26,6 +26,8 @@ from typing import AsyncGenerator
import aiohttp
from .. import aiotools
# =====
class StreamerError(Exception):
@@ -59,7 +61,7 @@ class StreamerClient:
params={"extra_headers": "1"},
headers={"User-Agent": self.__user_agent},
) as response:
response.raise_for_status()
aiotools.raise_not_200(response)
reader = aiohttp.MultipartReader.from_response(response)
while True:
frame = await reader.next() # pylint: disable=not-callable