diff --git a/defs/bilibili_download.py b/defs/bilibili_download.py index d8eb248..34a0c52 100644 --- a/defs/bilibili_download.py +++ b/defs/bilibili_download.py @@ -147,6 +147,8 @@ async def download_url(url: str, out: str, m: Message, start: str): async with sess.stream("GET", url) as resp: logger.info(f"Downloading {start}") resp: Response + if resp.status_code != 200: + raise BilibiliDownloaderError("下载链接异常,请尝试重新下载") length = resp.headers.get("content-length") if not length: raise FileNoSize diff --git a/requirements.txt b/requirements.txt index 540139f..6a49c83 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ pyrogram==2.0.106 tgcrypto==1.2.5 -bilibili-api-python==15.5.4 +bilibili-api-python==16.2.1 httpx pillow cashews