mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-16 04:45:27 +00:00
🐛 Fix AssetsService
Adapt to HoneyImpact's new resources' API
This commit is contained in:
parent
9aaf5fb50f
commit
5a64ba6abb
@ -120,7 +120,10 @@ class _AssetsService(ABC):
|
||||
error = None
|
||||
for _ in range(5):
|
||||
try:
|
||||
return await self.client.get(url, follow_redirects=False)
|
||||
response = await self.client.get(url, follow_redirects=False)
|
||||
if response.headers.get("content-length", None) == "2358":
|
||||
continue
|
||||
return response
|
||||
except (TransportError, SSLZeroReturnError) as e:
|
||||
error = e
|
||||
await asyncio.sleep(interval)
|
||||
@ -171,7 +174,8 @@ class _AssetsService(ABC):
|
||||
async for url in func(item):
|
||||
if url is not None:
|
||||
try:
|
||||
response = await self._request(url := str(url))
|
||||
if (response := await self._request(url := str(url))) is None:
|
||||
continue
|
||||
response.raise_for_status()
|
||||
yield url
|
||||
except HTTPStatusError:
|
||||
|
Loading…
Reference in New Issue
Block a user