Fix bad image downloads
This commit is contained in:
parent
cbc96b425c
commit
0c400fb4d5
|
@ -1,6 +1,6 @@
|
||||||
maubot: 0.1.0
|
maubot: 0.1.0
|
||||||
id: lomion.tmdb
|
id: lomion.tmdb
|
||||||
version: 1.3.0+scott-1fb64b9
|
version: 1.3.0+scott
|
||||||
license: AGPL 3.0
|
license: AGPL 3.0
|
||||||
modules:
|
modules:
|
||||||
- tmdb
|
- tmdb
|
||||||
|
|
|
@ -76,8 +76,11 @@ class TmdbApiSingle(TmdbApi):
|
||||||
|
|
||||||
async def query_image_binary(self):
|
async def query_image_binary(self):
|
||||||
if self.poster_url:
|
if self.poster_url:
|
||||||
async with self.session.get(self.poster_url) as resp:
|
try:
|
||||||
self.poster_binary = await resp.read()
|
async with self.session.get(self.poster_url) as resp:
|
||||||
|
self.poster_binary = await resp.read()
|
||||||
|
except aiohttp.client_exceptions.ClientConnectorError:
|
||||||
|
self.poster_binary = None
|
||||||
else:
|
else:
|
||||||
self.poster_binary = None
|
self.poster_binary = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue