Skip to main content

Python bindings for Specter HTTP client with TLS/HTTP2/HTTP3 fingerprint control

Project description

Specter

Python bindings for the Specter HTTP client - an HTTP client that accurately replicates Chrome's TLS and HTTP/2 behavior.

Installation

pip install specters

Features

  • HTTP/1.1, HTTP/2, and HTTP/3 support
  • Chrome 142 TLS fingerprint (BoringSSL)
  • Chrome HTTP/2 fingerprint (SETTINGS, pseudo-header order, GREASE)
  • Async/await interface
  • Cookie jar with Netscape format support

Usage

import asyncio
from specter import Client, FingerprintProfile

async def main():
    client = Client(fingerprint=FingerprintProfile.Chrome142)

    response = await client.get("https://example.com")
    print(f"Status: {response.status}")
    print(f"Body: {response.text()}")

asyncio.run(main())

Force HTTP version

from specter import HttpVersion

# HTTP/2 only
response = await client.get(url, version=HttpVersion.Http2)

# HTTP/3 with fallback
response = await client.get(url, version=HttpVersion.Http3)

Custom headers and cookies

from specter import CookieJar

jar = CookieJar()
await jar.load_from_file("cookies.txt")

response = await client.get(url, cookies=jar)
jar.store_from_headers(response.headers, url)

await jar.save_to_file("cookies.txt")

Validation

Specter fingerprints are validated against:

  • ScrapFly (tools.scrapfly.io)
  • Browserleaks (tls.browserleaks.com)
  • tls.peet.ws
  • Cloudflare

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

specters-2.0.0.tar.gz (28.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

specters-2.0.0-cp310-abi3-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

specters-2.0.0-cp310-abi3-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file specters-2.0.0.tar.gz.

File metadata

  • Download URL: specters-2.0.0.tar.gz
  • Upload date:
  • Size: 28.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for specters-2.0.0.tar.gz
Algorithm Hash digest
SHA256 1caae8714e57dca94621416b46b6a9f3c5a3e8b4600456373c7424fa989e366c
MD5 2d4a82ff0a5d495f854bb12bc9c915eb
BLAKE2b-256 780b2ff4d6fb48d46d42d78408670000f0577d852ddd2b02253c7b599bb9a904

See more details on using hashes here.

File details

Details for the file specters-2.0.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for specters-2.0.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d5963becec26cfa0cac0bbabe116659b68b243448bff989f4cc1cf35287090b
MD5 8a7e8f4fa4f391bb3dabbdc77d0e2eb0
BLAKE2b-256 6091f4668e615e0993db6faa16a0675572b4d2d6303ec66cb6d407751971c801

See more details on using hashes here.

File details

Details for the file specters-2.0.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for specters-2.0.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 34def188e2a9fd9cb7bb124bfedd9aa06f111e48e2cee17f879cf03954d6e852
MD5 1cb2aa917c96833cee37725766a5430c
BLAKE2b-256 868e20e33eacf4eadc7bb67c33e158fb735587b2f9ffea0a0122f09b35f3a56d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page