fix: bilibili download

This commit is contained in:
xtaodada 2024-04-04 00:18:09 +08:00
parent d4109d32ed
commit 8c84d4fdb5
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 3 additions and 1 deletions

View File

@ -147,6 +147,8 @@ async def download_url(url: str, out: str, m: Message, start: str):
async with sess.stream("GET", url) as resp: async with sess.stream("GET", url) as resp:
logger.info(f"Downloading {start}") logger.info(f"Downloading {start}")
resp: Response resp: Response
if resp.status_code != 200:
raise BilibiliDownloaderError("下载链接异常,请尝试重新下载")
length = resp.headers.get("content-length") length = resp.headers.get("content-length")
if not length: if not length:
raise FileNoSize raise FileNoSize

View File

@ -1,6 +1,6 @@
pyrogram==2.0.106 pyrogram==2.0.106
tgcrypto==1.2.5 tgcrypto==1.2.5
bilibili-api-python==15.5.4 bilibili-api-python==16.2.1
httpx httpx
pillow pillow
cashews cashews