Skip to main content

curlpro

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

import curlpro

curlpro.load_profiles("profiles")

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

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

Существующие решения хранят профили браузеров в компилируемом коде: новый 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.

Отпечаток сверен с 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, и ответ сервера, который ей пользуется, разбирается.

Установка

Пока собирается из исходников — нужны Go и C-компилятор:

.\build.ps1
cd python; $env:PYTHONPATH='.'; python -m pytest tests

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

Release files for curlpro 0.2.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.2.0
File Size Uploaded
curlpro-0.2.0.tar.gz 275.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for curlpro 0.2.0
File
curlpro-0.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
curlpro-0.2.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
curlpro-0.2.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
curlpro-0.2.0-py3-none-macosx_13_0_x86_64.whl Python 3 none macOS 13.0+ x86-64 Details
curlpro-0.2.0-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.0.tar.gz

Download URL curlpro-0.2.0.tar.gz
Size 275.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ca9b073fa39506eade06b367d91d18222721bda855baf81d7d96874b3ae935cd
BLAKE2b-256 checksum
How to use checksums
73fc47b0e568e29082398f207835b9273a3d0b836b0758b7f195f621ffa5ddd2
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 5, 2026.

Transparency log

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

Download URL curlpro-0.2.0-py3-none-win_amd64.whl
Size 9.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
0fa0a4fe0f64a4e3d6d7991b71c08ec997c6f4f8e0ee9e326b5fe3ebd93c4f36
BLAKE2b-256 checksum
How to use checksums
6dd159648a3fefdca88b8fd8e2ef2978e7282c795951066d61cc7f4d10757658
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 5, 2026.

Transparency log

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

Download URL curlpro-0.2.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
19db689dd3426db9fd6f5f93ddfefbbbe33ea29492717927495ccb4531c194ab
BLAKE2b-256 checksum
How to use checksums
cb7546b0b1225d6cb340162a1851efbc16dd3cdb3dc9d9edc652aa396e2a7f3e
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 5, 2026.

Transparency log

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

Download URL curlpro-0.2.0-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
acd9be39dd64bccdc4c23b0d7f22533bf42fb69a886307ad333838e6f5ac59d8
BLAKE2b-256 checksum
How to use checksums
1d3731efd84ba1133dc1649d06b49519e292615b62e3b3980fd4f845bb003754
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 5, 2026.

Transparency log

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

Download URL curlpro-0.2.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
37a6ad4c298d768a410c977e09392a0dbfc3c7f52c6b480dc3820fea5ca33267
BLAKE2b-256 checksum
How to use checksums
048d64fe62d79f90003c45a903c575e711f00553a0fa13343f4cce3f5c0fa1dc
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 5, 2026.

Transparency log

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

Download URL curlpro-0.2.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
53c45485d5cd3c9f6d3643e74c10d1110768584defc3a65f47c26ea07fa55ca3
BLAKE2b-256 checksum
How to use checksums
74e380a846a280affef76900e7e3c74f96c97523c1ff3e57dbdba9474e05e9c2
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 5, 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

0.2.1

6 release files

This release

0.2.0 This release

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