The only downloader you need. 下载器的集大成者。
TypeScript asyncasynciobittorentbtcross-platformdownload-managerdownloaderfluent-designftphttp3magnetpyqtpyside6pythonqtquicreactsoftwarestreaming
fix(http): #665
XiaoYouChRab10c2805124
diff --git a/app/client.py b/app/client.pyindex 743e841f..a04995e4 100644--- a/app/client.py+++ b/app/client.py@@ -97,6 +97,7 @@ def buildClient(userAgent: str | None = None,sourceUserAgent: str = "",timeout: int | None = None,+ readTimeout: int | None = None,) -> Client:resolved = toEmulation("") if emulation is ... else emulationconfig: ClientConfig = {"tls_verify": cfg.shouldVerifySsl.value, "redirect": Policy.limited(10)}@@ -136,6 +137,8 @@ def buildClient(if timeout is not None:config["timeout"] = timedelta(seconds=timeout)+ if readTimeout is not None:+ config["read_timeout"] = timedelta(seconds=readTimeout)return Client(**config)diff --git a/features/http_pack/task.py b/features/http_pack/task.pyindex b000b6a1..b208f2c4 100644--- a/features/http_pack/task.py+++ b/features/http_pack/task.py@@ -16,6 +16,7 @@ from app.config.cfg import cfgfrom app.models.task import Task, TaskError, TaskStep, TaskStatus, SpecialFileSizefrom app.platform.sysio import ftruncate, pwrite+STREAM_READ_TIMEOUT = 30PERMANENT_STATUS = frozenset({400, 401, 403, 404, 405, 410, 451})FATAL_IO_ERRNO = frozenset({errno.ENOSPC, errno.EDQUOT, errno.EROFS, errno.EIO, 39, 112})@@ -253,7 +254,7 @@ class HttpTaskStep(TaskStep):recordFile.close()async def _runSubworker(self, subworker: HttpSubworker, fd: int) -> None:- client = buildClient(emulation=self._emulation, userAgent=self.userAgent or None)+ client = buildClient(emulation=self._emulation, userAgent=self.userAgent or None, readTimeout=STREAM_READ_TIMEOUT)try:await self._runSubworkerWith(subworker, fd, client)finally: