Skip to main content

curlpro

HTTP-клиент с сетевым отпечатком браузера: TLS ClientHello, кадры HTTP/2 и HTTP/3, порядок и регистр заголовков.

pip install curlpro
import curlpro

with curlpro.Session("chrome-151-windows") as s:
    r = s.get("https://example.com")
    print(r.status, r.text[:200])

Ни Go, ни компилятора не нужно: нативная библиотека и все 47 профилей уже внутри колеса, и профили подхватываются сами.

Зачем ещё один

Существующие решения хранят профили браузеров в компилируемом коде: новый Chrome выходит каждые 4 недели, и каждый раз это правка C или Go, пересборка и релиз. Здесь профиль — данные, и его можно подключить в рантайме:

curlpro.register_profile({
    "name": "chrome-152-windows",
    "based_on": "chrome-151-windows",
    "headers": {"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) ... Chrome/152.0.0.0 ..."},
})

Что внутри

Тонкая ctypes-обёртка над нативной библиотекой на Go: рукопожатие ведёт uTLS, HTTP/2 — fhttp, QUIC — uquic.

Отпечаток сверен с tls.browserleaks.com: Chrome 151 даёт t13d1516h2_8daaf6152771_806a8c22fdea — тот же JA4, что живой браузер.

Границы

Библиотека закрывает сетевой слой. Она не подделывает JS-отпечаток (canvas, WebGL, navigator) — это уровень браузера, там нужен Playwright. Совпадение сетевого отпечатка необходимо, но не достаточно: современные системы скорят JA4 вместе с JA4H, JA3S/JARM и поведенческим анализом.

Поддерживаются HTTP/1.1, HTTP/2, HTTP/3 и WebSocket, куки, редиректы, прокси (HTTP CONNECT и SOCKS5), multipart, потоковое чтение и отправка, асинхронный API.

# WebSocket: рукопожатие по шаблону профиля браузера, permessage-deflate поддержан
with curlpro.Session() as s:
    with s.websocket("wss://echo.websocket.org/", max_message_size=1 << 20) as ws:
        ws.send("привет")        # str  → текстовый кадр
        ws.send(b"\x00\xff")     # bytes → двоичный
        for message in ws:       # до закрытия сервером — curlpro.WebSocketClosed;
            print(message)       # таймаут тишины — CurlProError с .code == "timeout"

# Большой файл уходит потоком, а не через память
with curlpro.Session() as s:
    s.post("https://example.com/upload", body_file="archive.zip")

# Соединение переиспользуется между запросами, как у браузера.
# keep_alive=False даёт каждому запросу своё — нужно, когда балансировщик
# прибивает клиента к одному узлу
with curlpro.Session(keep_alive=False) as s:
    s.get("https://example.com/")

Отпечаток HTTP/3 сверен с Chrome 144 на quic.browserleaks.com:

with curlpro.Session("chrome-151-windows", http3=True) as s:
    print(s.get("https://quic.browserleaks.com/fp").json()["h3_text"])
    # 1:65536;6:262144;7:100;51:1;GREASE|GREASE|984832|m,a,s,p

Динамическая таблица QPACK поддержана своим декодером: профиль объявляет ёмкость, как Chrome, и ответ сервера, который ей пользуется, разбирается.

Установка

Готовые колёса собраны для Linux (x86-64 и ARM64, glibc 2.28+), macOS 13+ (Intel и Apple Silicon) и Windows x64. Минимум macOS 13 задан не нами: столько требует Go 1.27, на котором собрана нативная часть.

Платформы вне этого списка — Alpine и другой musl, Windows на ARM, старые glibc или macOS — ставятся из исходного архива, и тогда нужны Go и компилятор C:

pip download curlpro --no-binary :all: --no-deps
tar -xzf curlpro-*.tar.gz && cd curlpro-*/go
CGO_ENABLED=1 go build -buildmode=c-shared -o ../curlpro/lib/libcurlpro.so ./lib

Библиотека ищется по CURLPRO_LIBRARY, затем в curlpro/lib/, затем в dist/.

Полная документация и исходники — github.com/int3re/curlpro.

Release files for curlpro 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for curlpro 0.3.0
File Size Uploaded
curlpro-0.3.0.tar.gz 300.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for curlpro 0.3.0
File
curlpro-0.3.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
curlpro-0.3.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
curlpro-0.3.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
curlpro-0.3.0-py3-none-macosx_13_0_x86_64.whl Python 3 none macOS 13.0+ x86-64 Details
curlpro-0.3.0-py3-none-macosx_13_0_arm64.whl Python 3 none macOS 13.0+ ARM64 Details

Total release size: 39.1 MB

Release files / curlpro-0.3.0.tar.gz

Download URL curlpro-0.3.0.tar.gz
Size 300.5 kB
Tags Source
SHA-256 checksum
How to use checksums
147adb2b340b8bb080cba48389b7b6d9a6967ff45e47dc6fea73159a4d3d7efe
BLAKE2b-256 checksum
How to use checksums
7d3c12d590188d8355921405c802aac8825d12d5060f4731fc3ffc394db99421
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / curlpro-0.3.0-py3-none-win_amd64.whl

Download URL curlpro-0.3.0-py3-none-win_amd64.whl
Size 9.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
dbb4f62f95269fa4a439701d918f9ed889b25732d6bbddd698e02c884527f515
BLAKE2b-256 checksum
How to use checksums
cbcd03208578b50820cd800a1348d3be9d567af0c4f3b17a878db18bae732846
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / curlpro-0.3.0-py3-none-manylinux_2_28_x86_64.whl

Download URL curlpro-0.3.0-py3-none-manylinux_2_28_x86_64.whl
Size 9.8 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
1117f767f740e43299a3b40d1d93685d38a6312115dc213a5d1ba6fca723cd04
BLAKE2b-256 checksum
How to use checksums
08b815a5a270140f252a01acdc2f19d61d01ee2f3e8a0fcbb3b82e4c1cb96af0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / curlpro-0.3.0-py3-none-manylinux_2_28_aarch64.whl

Download URL curlpro-0.3.0-py3-none-manylinux_2_28_aarch64.whl
Size 9.0 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
4e7cf43686792ec51e3cd1337c20cf0714419b9f902a18542e478b6971982f69
BLAKE2b-256 checksum
How to use checksums
e57f5ffb5ad470b62702af54f8f2fb8cd14593f125b2ca994f5ed94a7964c229
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / curlpro-0.3.0-py3-none-macosx_13_0_x86_64.whl

Download URL curlpro-0.3.0-py3-none-macosx_13_0_x86_64.whl
Size 5.4 MB
Tags Python 3 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
6f7b3742a2b5cfba743eae4d36b2ee65cbd93da3abfe181861e4f587ad6f54c3
BLAKE2b-256 checksum
How to use checksums
c0d910dd77d614590932b8cc56977b5ed43591e4cba94c0ec28ee0eeb515c8b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / curlpro-0.3.0-py3-none-macosx_13_0_arm64.whl

Download URL curlpro-0.3.0-py3-none-macosx_13_0_arm64.whl
Size 5.0 MB
Tags Python 3 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
c2d84905e8b0a5206fa632057ff98b874fd7b574f91841476bce20b37babcd83
BLAKE2b-256 checksum
How to use checksums
2475912cd7db6681c22f5d947fcba48137082e8bdc6d0424e7c1fc47deec9a6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release history Release notifications | RSS feed

0.12.0

6 release files

0.11.0

6 release files

0.10.1

6 release files

0.10.0

6 release files

0.9.0

6 release files

0.8.0

6 release files

0.7.2

6 release files

0.7.1

6 release files

0.7.0

6 release files

0.6.0

6 release files

0.5.2

6 release files

0.5.1

6 release files

0.5.0

6 release files

0.4.3

6 release files

0.4.2

6 release files

0.4.1

6 release files

0.4.0

6 release files

This release

0.3.0 This release

6 release files

0.2.1

6 release files

0.2.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page