Files
MediaCrawler/tools/httpx_util.py
Wei Liu 2970488f40 docs: 将新增注释和文档改为中文
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 12:44:37 +13:00

14 lines
472 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
import httpx
import config
def make_async_client(**kwargs) -> httpx.AsyncClient:
"""创建统一配置的 httpx.AsyncClient。
从配置文件读取 DISABLE_SSL_VERIFY默认 False即开启 SSL 验证)。
仅在使用企业代理、Burp、mitmproxy 等中间人代理时才需将其设为 True。
"""
kwargs.setdefault("verify", not getattr(config, "DISABLE_SSL_VERIFY", False))
return httpx.AsyncClient(**kwargs)