This commit is contained in:
2026-07-09 02:52:54 +02:00
parent 818568c609
commit 48bb6c2ec2
95 changed files with 6115 additions and 267 deletions
+9 -1
View File
@@ -73,10 +73,17 @@ class CurlResponseStream(httpx.AsyncByteStream):
class CurlTransport(httpx.AsyncBaseTransport):
def __init__(self, *, impersonate: str = IMPERSONATE_TARGET, verify: bool = True) -> None:
def __init__(
self,
*,
impersonate: str = IMPERSONATE_TARGET,
verify: bool = True,
proxy: str | None = None,
) -> None:
self._session = AsyncSession()
self._impersonate = impersonate
self._verify = verify
self._proxy = proxy
async def handle_async_request(self, request: httpx.Request) -> httpx.Response:
headers = {
@@ -97,6 +104,7 @@ class CurlTransport(httpx.AsyncBaseTransport):
data=body or None,
impersonate=self._impersonate,
verify=self._verify,
proxy=self._proxy,
stream=True,
allow_redirects=False,
timeout=resolve_timeout(request),