Skip to content

The only downloader you need. 下载器的集大成者。

gzip 支持

XiaoYouChRd40cf42147e7
diff --git a/app/common/download_task.py b/app/common/download_task.py
index e29b8560..1f069bc4 100644
--- a/app/common/download_task.py
+++ b/app/common/download_task.py
@@ -13,7 +13,7 @@ from app.common.config import cfg
from app.common.methods import getProxy, getReadableSize, getLinkInfo
Headers = {
- "accept-encoding": "deflate, br",
+ "accept-encoding": "deflate, br, gzip",
"accept-language": "zh-CN,zh;q=0.9",
"cookie": "down_ip=1",
"sec-fetch-dest": "document",
@@ -208,7 +208,7 @@ class DownloadTask(QThread):
async with worker.client.stream(url=self.url, headers=download_headers, timeout=30,
method="GET") as res:
- async for chunk in res.aiter_raw(chunk_size=65536): # aiter_content 的单位是字节, 即每64K写一次文件
+ async for chunk in res.aiter_bytes(chunk_size=65536): # aiter_content 的单位是字节, 即每64K写一次文件
if worker.endPos <= worker.process:
break
if chunk: