HTTP client that can impersonate web browsers, mimicking their headers and `TLS/JA3/JA4/HTTP2` fingerprints
Project description
Pyreqwest_impersonate
HTTP client that can impersonate web browsers, mimicking their headers and TLS/JA3/JA4/HTTP2
fingerprints.
Binding to the Rust reqwest_impersonate
library.
Provides precompiled wheels:
- Linux:
amd64
,aarch64
. - Windows:
amd64
. - MacOS:
amd64
,aarch64
.
Installation
pip install -U pyreqwest_impersonate
Usage
I. Client
A blocking HTTP client that can impersonate web browsers.
class Client:
"""Initializes a blocking HTTP client that can impersonate web browsers.
Args:
auth (tuple, optional): A tuple containing the username and password for basic authentication. Default is None.
auth_bearer (str, optional): Bearer token for authentication. Default is None.
params (dict, optional): Default query parameters to include in all requests. Default is None.
headers (dict, optional): Default headers to send with requests. If `impersonate` is set, this will be ignored.
timeout (float, optional): HTTP request timeout in seconds. Default is 30.
proxy (str, optional): Proxy URL for HTTP requests. Example: "socks5://127.0.0.1:9150". Default is None.
impersonate (str, optional): Entity to impersonate. Example: "chrome_123". Default is None.
Chrome: "chrome_99","chrome_100","chrome_101","chrome_104","chrome_105","chrome_106","chrome_108",
"chrome_107","chrome_109","chrome_114","chrome_116","chrome_117","chrome_118","chrome_119",
"chrome_120","chrome_123"
Safari: "safari_12","safari_15_3","safari_15_5","safari_15_6_1","safari_16","safari_16_5","safari_17_2_1"
OkHttp: "okhttp_3_9","okhttp_3_11","okhttp_3_13","okhttp_3_14","okhttp_4_9","okhttp_4_10","okhttp_5"
Edge: "edge_99","edge_101","edge_120"
follow_redirects (bool, optional): Whether to follow redirects. Default is False.
max_redirects (int, optional): Maximum redirects to follow. Default 20. Applies if `follow_redirects` is True.
verify (bool, optional): Verify SSL certificates. Default is True.
http1 (bool, optional): Use only HTTP/1.1. Default is None.
http2 (bool, optional): Use only HTTP/2. Default is None.
"""
Client Methods
The Client
class provides a set of methods for making HTTP requests: get
, head
, options
, delete
, post
, put
, patch
, each of which internally utilizes the request()
method for execution. The parameters for these methods closely resemble those in httpx
.
get(url, *, params=None, headers=None, auth=None, auth_bearer=None, timeout=None)
Performs a GET request to the specified URL.
- url (str): The URL to which the request will be made.
- params (Optional[Dict[str, str]]): A map of query parameters to append to the URL. Default is None.
- headers (Optional[Dict[str, str]]): A map of HTTP headers to send with the request. Default is None.
- auth (Optional[Tuple[str, Optional[str]]]): A tuple containing the username and an optional password for basic authentication. Default is None.
- auth_bearer (Optional[str]): A string representing the bearer token for bearer token authentication. Default is None.
- timeout (Optional[float]): The timeout for the request in seconds. Default is 30.
post(url, *, params=None, headers=None, content=None, data=None, files=None, auth=None, auth_bearer=None, timeout=None)
Performs a POST request to the specified URL.
- url (str): The URL to which the request will be made.
- params (Optional[Dict[str, str]]): A map of query parameters to append to the URL. Default is None.
- headers (Optional[Dict[str, str]]): A map of HTTP headers to send with the request. Default is None.
- content (Optional[bytes]): The content to send in the request body as bytes. Default is None.
- data (Optional[Dict[str, str]]): The form data to send in the request body. Default is None.
- files (Optional[Dict[str, str]]): A map of file fields to file paths to be sent as multipart/form-data. Default is None.
- auth (Optional[Tuple[str, Optional[str]]]): A tuple containing the username and an optional password for basic authentication. Default is None.
- auth_bearer (Optional[str]): A string representing the bearer token for bearer token authentication. Default is None.
- timeout (Optional[float]): The timeout for the request in seconds. Default is 30.
Examples:
Client.get()
from pyreqwest_impersonate import Client
client = Client(impersonate="chrome_123")
resp = client.get("https://tls.peet.ws/api/all")
print(resp.text)
print(resp.status_code)
print(resp.url)
print(resp.headers)
print(resp.cookies)
Client.post()
from pyreqwest_impersonate import Client
data = {"key1": "value1", "key2": "value2"}
auth = ("user", "password")
resp = Client().post(url="https://httpbin.org/anything", data=data, auth=auth)
print(resp.text)
II. AsyncClient
TODO
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Close
Hashes for pyreqwest_impersonate-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b15478d0d3034c9346b9f20313e62fef3d29e77a108bc81488e0f6a75ae86a2 |
|
MD5 | d3a7c85882c53c83e9ef8e6fa5633cde |
|
BLAKE2b-256 | c48dde9d490bdd5d96a7c6325dccdbfdc7e64e78ac1a6989fa9dff64abc776a4 |
Close
Hashes for pyreqwest_impersonate-0.1.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e118b930c3b739fe5a288e79d74563826df06f922761b0eff803a9bf9392e40 |
|
MD5 | b776e40dc8f66e13330d5bd163b35ed3 |
|
BLAKE2b-256 | aaf8aa3c8c9593f800391e71b96824cdf20b5d1215997fb3c971e941dbee918f |
Close
Hashes for pyreqwest_impersonate-0.1.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76600f6d730dfd9dc5c00430a3c5c62d6dbdf3a2f453729d6993961a77e08f3d |
|
MD5 | 8e49461ec399cef2a05247436473962a |
|
BLAKE2b-256 | 057a049a29af156af221d96f93f370af129958ce546a4f4031f4747e074abfaa |
Close
Hashes for pyreqwest_impersonate-0.1.3-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1939fc07abbe8e0877d3f72475773b4dd973617751947dcc7e54e116f338eafe |
|
MD5 | 83eb6fd0325be334a1c4a107826840e7 |
|
BLAKE2b-256 | 521eb928864ed0ce43979f3352eccf13f29807fbb6344bba89e6c5dfeb224034 |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25dc43bbf59442747b73f0f70569c20205e6f30b3f12000e98864cba0a4a646a |
|
MD5 | 386802ecb84e21648190669d50a5daf7 |
|
BLAKE2b-256 | bfdbc1bc103dd9c3d9cd8f2dbdd355cac040c31365702a8d36fb0651fb6a316f |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0164e91a6c779a27d4f0d574d3097e1e6a11f2d11830bbc008caf02170ebaff6 |
|
MD5 | ded0403c0979cab76d5afe8281b160fa |
|
BLAKE2b-256 | 1dd20c97a42e4826c804c035a8758e946bf71cdd6c259eeeede0d7200a17707d |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9b674bd8d6b8dd96346bc6e50ed62f965e34ff1cfb199b8102b094c96936220 |
|
MD5 | 874cec089faee120b8540380924dfec3 |
|
BLAKE2b-256 | 50aeb60f7518419ccc6a0c731d6ee9daa525c9ee1693dfaf2cfd0522d83e5abf |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba935bb5c7278a41b6252af33a3ed10e242e911dce2d485900d80481ce376cd9 |
|
MD5 | 50e3f279a95f3ff4b755651e9ac8000a |
|
BLAKE2b-256 | 619bfdd0eae7e60ba050b1f8488430d33e6b1ce181135e41c7d3947f6d05973e |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0825d841b49e091c54b2bbdddb3f7918463ad0fa7b13f19722b81fb7722860b4 |
|
MD5 | 324bfea939e97e2919d6f6db8a5bbc5b |
|
BLAKE2b-256 | ad02381f5f6662cd40ca919610124e7798628c4ffbe4de77c1b2605599420539 |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 194f0146b5f998153e0f36ab612f20c0e382f20090d1dce2c791247307a8864c |
|
MD5 | cda13333751c5e37e261e796204b8c5d |
|
BLAKE2b-256 | ad243d061358e2fa7900c0bb4aab026da220b23fd183faba27f198e622f4a70d |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bced3de68b68801d9d5ad8614744afb3a8c7a1ae7888b61dbbdc27f526acc1a |
|
MD5 | abe18769d40c3510fadaf26225b70d4f |
|
BLAKE2b-256 | 365deb3170ff63d41356b83cab45a54a38a39346d9d93fec496fe23cfdf26390 |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bd312639889125efdc61989ebc0bf302c1123192a8a71251d5e7affbf701cf8 |
|
MD5 | e9cb49a05f2cc8ad813ce62c110009fe |
|
BLAKE2b-256 | 91922584d783412573f7e702f2feb7ad3fbe2be3f7bd4a7e9e0e3f204f3a9f6b |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bfc9c27617d062360a93e7de162ac0622aff635934a98c7b337dbe63c4b8b1f |
|
MD5 | 589c88fca2651070857ad484eb0b88be |
|
BLAKE2b-256 | 88052c556615d2708c87a0a893ade6054dc64ce0ea418f4319b4ce3705e0f2cd |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4cb6111f7462ac464bb25ef95287f1dc9be07a9c28c08d686bb1fd35df0b32d |
|
MD5 | 1afb0c3c1f8e167804fa9adca085ff21 |
|
BLAKE2b-256 | c5e1d2a070c580c1447d476dcee3c781026cadfe4499579fbfff34df1be60fd8 |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 555c4c2a466e016a55a564bb575d16b1d263440a64367e4f3ef0bda18ad18cfd |
|
MD5 | 82d0823b20d9aa14f81954fb2ab34a1c |
|
BLAKE2b-256 | bcaec98c4102cfbc92e14c538d7b7f1693f004e06c721659548e1e32f1f6c556 |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cd16d6e07b611e1f83696713501e74be2ac99a02dafd3bf2858510003c9842a |
|
MD5 | cdb6b5be8d264cbc7f7ae2b05e764965 |
|
BLAKE2b-256 | 2f400e617b3f834ce96a065dc6213e061784c19572f170c8957a924b653a1c8c |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5594a93270f57249959275f28f6f1073aff09b0fb6743f5da56c3b5958bb7883 |
|
MD5 | f7af3a6944e961a74386ccf8cbc3a5d7 |
|
BLAKE2b-256 | afbae722b86fa7906b2397e2a812c5e2759c5434fb64be053ac9088dee2b5231 |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0407a8ca3cae0fe379e05a870da9a01ec7bc6d1c2749cc4fbe40b455a2f891f |
|
MD5 | 6ea8eb4f0151a065bf7a70bf3a87a127 |
|
BLAKE2b-256 | 2d012a392aaf0d4a2527860dbfecc35fe73df0f127bac42064c0bcecc4d8201b |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f80daa76644ea88b8da9ef219f049228006c511adaa9d2331ac844a101a68e1e |
|
MD5 | 4a062d3e0698f9262591e59b70519ee8 |
|
BLAKE2b-256 | 41a4229bc3ab6c3273a5a60987f7a9095a7a349f6eb124a5b808d5eb2d0565a2 |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4d616af5356134db95d50ad9c33014cdbe302833321ed0358a2bd261a2fe752 |
|
MD5 | 96ae3f9dcbeda41b8670eaea41dedd6b |
|
BLAKE2b-256 | a85dd8b2a5a923c6e7a188bb05aa53f726dbba5e00eab3b16d77939e5630b9c6 |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cbc1e393b4d03b1a0627cf583ae4ea785750302850deed83a2e8da79be3e0c1 |
|
MD5 | 8a9a67ee096590c309b73a568c43d2d4 |
|
BLAKE2b-256 | 940a0e41597ea789feb57918adcc7fe3edbe433f4cae918636b5f0c8d5392493 |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca0e0af113d13c82302c9111ad4ecc45c072c4bfb5154d7ad37cc7a0247fca9d |
|
MD5 | f8278a6a5686908a0c336802433b06f9 |
|
BLAKE2b-256 | 9486735913cd5c67a565939991e391d97557013e52edb7215d3750d3b6be6325 |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06e6ba5202f70b9db806094c47516cbcdddb4a3935c4e9743088eb4eb9184139 |
|
MD5 | 3fa37214a564061ef78d2420fb92ade2 |
|
BLAKE2b-256 | 44b47e1212b6037b84842137f15027d4658c2993fd99037522c826d1cdfeaa52 |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a6ac60aa33b6399a2dcc29d7712d52cb4a19ba905b764b8ce91fda015d5fdf1 |
|
MD5 | 878f53187fc88960307b22ed284baca0 |
|
BLAKE2b-256 | 67886ea6bc878b85c131296da2af034ebafa9c7afbb97e106ff1cb7e6abfd64b |
Close
Hashes for pyreqwest_impersonate-0.1.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e073259ba04c1e986bfc1b39a136b5f00458e113481f62bf3048f609e612000 |
|
MD5 | 95da38e2f9befb23a203326749f45acf |
|
BLAKE2b-256 | 13bbb59b55a1d5d711e0b1592a03b7a98c1d81ffd0c7966bc0874bfdc8616ee4 |