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.2.1

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.2.1
File Size Uploaded
curlpro-0.2.1.tar.gz 276.2 kB Details

Built distributions (wheels)

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

Total release size: 38.9 MB

Release files / curlpro-0.2.1.tar.gz

Download URL curlpro-0.2.1.tar.gz
Size 276.2 kB
Tags Source
SHA-256 checksum
How to use checksums
de5baacde628c65277385497ba56156c282341a0473481ad5edd03f3c0844e7f
BLAKE2b-256 checksum
How to use checksums
54d862697a9c1d41a62079bceb1bd96de4f11e14936c36a8d410b1697d8457ca
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.2.1-py3-none-win_amd64.whl

Download URL curlpro-0.2.1-py3-none-win_amd64.whl
Size 9.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
1a8dfebaf3d0ca5fbed5d48ee51d76ed767935e44ffaef876eb5a5c3391b99d5
BLAKE2b-256 checksum
How to use checksums
696014c6c6122516a2add5f7cdb18a765c7c65a83145b3fb6f0429ce99e3e62b
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.2.1-py3-none-manylinux_2_28_x86_64.whl

Download URL curlpro-0.2.1-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
399031ee6eea5e08e3b27d1e7a0f9a4ab94880dcac27c1df2c2308b56ee8861f
BLAKE2b-256 checksum
How to use checksums
10104bd8c39a7aee7e9e83e285715c147245453c5b03e3df0e65752b35988cbe
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.2.1-py3-none-manylinux_2_28_aarch64.whl

Download URL curlpro-0.2.1-py3-none-manylinux_2_28_aarch64.whl
Size 8.9 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
a9ffff0297b6ab334ca17c81ed094a5f19701a58abc208f198392c6a9dc2d78f
BLAKE2b-256 checksum
How to use checksums
333cfa3515d3072d72dd2bb412362d91f9c7b1db3cd8067859de4b6f04c03073
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.2.1-py3-none-macosx_13_0_x86_64.whl

Download URL curlpro-0.2.1-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
f3e77c9f1adaef7cbed68b3268b1263fd43b701e888c7ac1974365409703e85a
BLAKE2b-256 checksum
How to use checksums
2b36048717d90abdd6ae5cdff0079960064b330fab054064d7f5df0eaefc7d5e
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.2.1-py3-none-macosx_13_0_arm64.whl

Download URL curlpro-0.2.1-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
d504017abbb73789a01322c6666fa08fbad0988238b749ceae9eebaea3bfaacf
BLAKE2b-256 checksum
How to use checksums
12dcffb4e64694040811d386f7156d9ec3fc661abb3b7c7820a1397fadc0c664
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

0.3.0

6 release files

This release

0.2.1 This release

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