Handle FloodWaitError in client.download_media

Fixes #1426. Not entirely happy with the new indirection layer,
but the original __call__ method is already a mess anyway and
the additional cost of an extra call should be neglible compared
to the actual IO.
This commit is contained in:
Lonami Exo
2020-04-28 20:49:57 +02:00
parent 7f3aa43ad4
commit 7ea4686d6c
3 changed files with 6 additions and 3 deletions

View File

@@ -68,7 +68,7 @@ class _DirectDownloadIter(RequestIter):
async def _request(self):
try:
result = await self._sender.send(self.request)
result = await self.client._call(self._sender, self.request)
if isinstance(result, types.upload.FileCdnRedirect):
raise NotImplementedError # TODO Implement
else: