mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🎨 fix pre-commit.ci
This commit is contained in:
parent
07ea6b060e
commit
0c155bc2b8
@ -42,7 +42,7 @@ class AsyncHttpx:
|
|||||||
verify: bool = True,
|
verify: bool = True,
|
||||||
use_proxy: bool = True,
|
use_proxy: bool = True,
|
||||||
proxy: dict[str, str] | None = None,
|
proxy: dict[str, str] | None = None,
|
||||||
timeout: int = 30,
|
timeout: int = 30, # noqa: ASYNC109
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> Response:
|
) -> Response:
|
||||||
"""Get
|
"""Get
|
||||||
@ -97,7 +97,7 @@ class AsyncHttpx:
|
|||||||
verify: bool = True,
|
verify: bool = True,
|
||||||
use_proxy: bool = True,
|
use_proxy: bool = True,
|
||||||
proxy: dict[str, str] | None = None,
|
proxy: dict[str, str] | None = None,
|
||||||
timeout: int = 30,
|
timeout: int = 30, # noqa: ASYNC109
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> Response:
|
) -> Response:
|
||||||
if not headers:
|
if not headers:
|
||||||
@ -124,7 +124,7 @@ class AsyncHttpx:
|
|||||||
verify: bool = True,
|
verify: bool = True,
|
||||||
use_proxy: bool = True,
|
use_proxy: bool = True,
|
||||||
proxy: dict[str, str] | None = None,
|
proxy: dict[str, str] | None = None,
|
||||||
timeout: int = 30,
|
timeout: int = 30, # noqa: ASYNC109
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> Response:
|
) -> Response:
|
||||||
"""Get
|
"""Get
|
||||||
@ -167,7 +167,7 @@ class AsyncHttpx:
|
|||||||
params: dict[str, str] | None = None,
|
params: dict[str, str] | None = None,
|
||||||
headers: dict[str, str] | None = None,
|
headers: dict[str, str] | None = None,
|
||||||
cookies: dict[str, str] | None = None,
|
cookies: dict[str, str] | None = None,
|
||||||
timeout: int = 30,
|
timeout: int = 30, # noqa: ASYNC109
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> Response:
|
) -> Response:
|
||||||
"""
|
"""
|
||||||
@ -220,7 +220,7 @@ class AsyncHttpx:
|
|||||||
proxy: dict[str, str] | None = None,
|
proxy: dict[str, str] | None = None,
|
||||||
headers: dict[str, str] | None = None,
|
headers: dict[str, str] | None = None,
|
||||||
cookies: dict[str, str] | None = None,
|
cookies: dict[str, str] | None = None,
|
||||||
timeout: int = 30,
|
timeout: int = 30, # noqa: ASYNC109
|
||||||
stream: bool = False,
|
stream: bool = False,
|
||||||
follow_redirects: bool = True,
|
follow_redirects: bool = True,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
@ -340,7 +340,7 @@ class AsyncHttpx:
|
|||||||
proxy: dict[str, str] | None = None,
|
proxy: dict[str, str] | None = None,
|
||||||
headers: dict[str, str] | None = None,
|
headers: dict[str, str] | None = None,
|
||||||
cookies: dict[str, str] | None = None,
|
cookies: dict[str, str] | None = None,
|
||||||
timeout: int = 30,
|
timeout: int = 30, # noqa: ASYNC109
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> list[bool]:
|
) -> list[bool]:
|
||||||
"""分组同时下载文件
|
"""分组同时下载文件
|
||||||
@ -380,22 +380,22 @@ class AsyncHttpx:
|
|||||||
tasks = []
|
tasks = []
|
||||||
result_ = []
|
result_ = []
|
||||||
for x, y in zip(_split_url_list, _split_path_list):
|
for x, y in zip(_split_url_list, _split_path_list):
|
||||||
for url, path in zip(x, y):
|
tasks.extend(
|
||||||
tasks.append(
|
asyncio.create_task(
|
||||||
asyncio.create_task(
|
cls.download_file(
|
||||||
cls.download_file(
|
url,
|
||||||
url,
|
path,
|
||||||
path,
|
params=params,
|
||||||
params=params,
|
headers=headers,
|
||||||
headers=headers,
|
cookies=cookies,
|
||||||
cookies=cookies,
|
use_proxy=use_proxy,
|
||||||
use_proxy=use_proxy,
|
timeout=timeout,
|
||||||
timeout=timeout,
|
proxy=proxy,
|
||||||
proxy=proxy,
|
**kwargs,
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
for url, path in zip(x, y)
|
||||||
|
)
|
||||||
_x = await asyncio.gather(*tasks)
|
_x = await asyncio.gather(*tasks)
|
||||||
result_ = result_ + list(_x)
|
result_ = result_ + list(_x)
|
||||||
tasks.clear()
|
tasks.clear()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user