libcurl ffi bindings for Python
Project description
Python Curl CFFI
CFFI bindings for libcurl with the ability to impersonate browsers' TLS signatures.
Install
pip install curl_cffi
Usage
from curl_cffi import Curl, CurlOpt, CurlInfo
from io import BytesIO
buffer = BytesIO()
c = Curl()
c.setopt(CurlOpt.URL, b'https://ja3er.com/json')
c.setopt(CurlOpt.WRITEDATA, buffer)
c.perform()
c.close()
body = buffer.getvalue()
print(body.decode())
API
Curl object:
- setopt(CurlOpt, value): Sets curl options as in
curl_easy_setopt
- perform(): Performs curl request, as in
curl_easy_perform
- getinfo(CurlInfo): Gets information in response after curl perform, as in
curl_easy_getinfo
- close(): Closes and cleans up the curl object, as in
curl_easy_cleanup
Enum values to be used with setopt
and getinfo
can be accessed from CurlOpt
and CurlInfo
.
Acknowledgement
This module is forked from https://github.com/multippt/python_curl_cffi
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
curl_cffi-0.1.5.tar.gz
(7.9 kB
view details)
File details
Details for the file curl_cffi-0.1.5.tar.gz
.
File metadata
- Download URL: curl_cffi-0.1.5.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
be3d01c431b9844fc202f72b5b970237a518854414852ee25596277e55bdde33
|
|
MD5 |
d0441b13a62cc1b675aebce250d704d9
|
|
BLAKE2b-256 |
c748a83746b63806ca07a4b391c5fc402519b024996c3d4f1a560040979a6e0d
|