rnet 3.0.0rc4__cp311-abi3-musllinux_1_2_armv7l.whl → 3.0.0rc6__cp311-abi3-musllinux_1_2_armv7l.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rnet might be problematic. Click here for more details.
- rnet/__init__.py +1 -0
- rnet/__init__.pyi +14 -8
- rnet/blocking.py +23 -8
- rnet/exceptions.py +6 -0
- rnet/rnet.abi3.so +0 -0
- rnet/tls.py +6 -18
- {rnet-3.0.0rc4.dist-info → rnet-3.0.0rc6.dist-info}/METADATA +5 -6
- rnet-3.0.0rc6.dist-info/RECORD +15 -0
- rnet-3.0.0rc4.dist-info/RECORD +0 -15
- {rnet-3.0.0rc4.dist-info → rnet-3.0.0rc6.dist-info}/WHEEL +0 -0
- {rnet-3.0.0rc4.dist-info → rnet-3.0.0rc6.dist-info}/licenses/LICENSE +0 -0
rnet/__init__.py
CHANGED
rnet/__init__.pyi
CHANGED
|
@@ -10,15 +10,16 @@ from typing import (
|
|
|
10
10
|
Dict,
|
|
11
11
|
List,
|
|
12
12
|
TypedDict,
|
|
13
|
+
Unpack,
|
|
14
|
+
NotRequired,
|
|
13
15
|
)
|
|
14
16
|
from pathlib import Path
|
|
15
17
|
from enum import Enum, auto
|
|
16
|
-
from typing import Unpack, NotRequired
|
|
17
18
|
|
|
18
19
|
from .cookie import Cookie, Jar
|
|
19
20
|
from .header import HeaderMap, OrigHeaderMap
|
|
20
21
|
from .emulation import Emulation, EmulationOption
|
|
21
|
-
from .tls import TlsVersion, Identity,
|
|
22
|
+
from .tls import TlsVersion, Identity, KeyLog, CertStore
|
|
22
23
|
|
|
23
24
|
class Method(Enum):
|
|
24
25
|
r"""
|
|
@@ -464,6 +465,16 @@ class Response:
|
|
|
464
465
|
Get the DER encoded leaf certificate of the response.
|
|
465
466
|
"""
|
|
466
467
|
|
|
468
|
+
def raise_for_status(self) -> None:
|
|
469
|
+
r"""
|
|
470
|
+
Turn a response into an error if the server returned an error.
|
|
471
|
+
"""
|
|
472
|
+
|
|
473
|
+
def stream(self) -> Streamer:
|
|
474
|
+
r"""
|
|
475
|
+
Get the response into a `Streamer` of `bytes` from the body.
|
|
476
|
+
"""
|
|
477
|
+
|
|
467
478
|
async def text(self) -> str:
|
|
468
479
|
r"""
|
|
469
480
|
Get the text content of the response.
|
|
@@ -484,11 +495,6 @@ class Response:
|
|
|
484
495
|
Get the bytes content of the response.
|
|
485
496
|
"""
|
|
486
497
|
|
|
487
|
-
def stream(self) -> Streamer:
|
|
488
|
-
r"""
|
|
489
|
-
Get the response into a `Stream` of `Bytes` from the body.
|
|
490
|
-
"""
|
|
491
|
-
|
|
492
498
|
async def close(self) -> None:
|
|
493
499
|
r"""
|
|
494
500
|
Close the response connection.
|
|
@@ -661,7 +667,7 @@ class ClientParams(TypedDict):
|
|
|
661
667
|
identity: NotRequired[Identity]
|
|
662
668
|
"""Represents a private key and X509 cert as a client certificate."""
|
|
663
669
|
|
|
664
|
-
keylog: NotRequired[
|
|
670
|
+
keylog: NotRequired[KeyLog]
|
|
665
671
|
"""Key logging policy (environment or file)."""
|
|
666
672
|
|
|
667
673
|
tls_info: NotRequired[bool]
|
rnet/blocking.py
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import datetime
|
|
2
|
-
from rnet import
|
|
2
|
+
from rnet import (
|
|
3
|
+
ClientParams,
|
|
4
|
+
History,
|
|
5
|
+
Message,
|
|
6
|
+
Request,
|
|
7
|
+
Streamer,
|
|
8
|
+
WebSocketRequest,
|
|
9
|
+
Version,
|
|
10
|
+
Method,
|
|
11
|
+
SocketAddr,
|
|
12
|
+
StatusCode,
|
|
13
|
+
)
|
|
3
14
|
from typing import (
|
|
4
15
|
Optional,
|
|
5
16
|
Any,
|
|
@@ -7,7 +18,6 @@ from typing import (
|
|
|
7
18
|
Unpack,
|
|
8
19
|
)
|
|
9
20
|
|
|
10
|
-
from rnet import Version, Method, SocketAddr, StatusCode
|
|
11
21
|
from rnet.header import HeaderMap
|
|
12
22
|
from rnet.cookie import Cookie
|
|
13
23
|
|
|
@@ -67,6 +77,17 @@ class Response:
|
|
|
67
77
|
Get the DER encoded leaf certificate of the response.
|
|
68
78
|
"""
|
|
69
79
|
|
|
80
|
+
def raise_for_status(self) -> None:
|
|
81
|
+
r"""
|
|
82
|
+
Turn a response into an error if the server returned an error.
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
def stream(self) -> Streamer:
|
|
86
|
+
r"""
|
|
87
|
+
Get the response into a `Streamer` of `bytes` from the body.
|
|
88
|
+
"""
|
|
89
|
+
...
|
|
90
|
+
|
|
70
91
|
def text(self) -> str:
|
|
71
92
|
r"""
|
|
72
93
|
Get the text content of the response.
|
|
@@ -90,12 +111,6 @@ class Response:
|
|
|
90
111
|
"""
|
|
91
112
|
...
|
|
92
113
|
|
|
93
|
-
def stream(self) -> Streamer:
|
|
94
|
-
r"""
|
|
95
|
-
Get the response into a `Stream` of `Bytes` from the body.
|
|
96
|
-
"""
|
|
97
|
-
...
|
|
98
|
-
|
|
99
114
|
def close(self) -> None:
|
|
100
115
|
r"""
|
|
101
116
|
Close the response connection.
|
rnet/exceptions.py
CHANGED
|
@@ -28,6 +28,12 @@ __all__ = [
|
|
|
28
28
|
# ========================================
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
class RustPanic(Exception):
|
|
32
|
+
r"""
|
|
33
|
+
A panic occurred in the underlying Rust code.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
|
|
31
37
|
class DNSResolverError(RuntimeError):
|
|
32
38
|
r"""
|
|
33
39
|
An error occurred while resolving a DNS name.
|
rnet/rnet.abi3.so
CHANGED
|
Binary file
|
rnet/tls.py
CHANGED
|
@@ -10,7 +10,7 @@ from enum import Enum, auto
|
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
from typing import List
|
|
12
12
|
|
|
13
|
-
__all__ = ["TlsVersion", "Identity", "CertStore", "
|
|
13
|
+
__all__ = ["TlsVersion", "Identity", "CertStore", "KeyLog"]
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class TlsVersion(Enum):
|
|
@@ -111,7 +111,7 @@ class CertStore:
|
|
|
111
111
|
...
|
|
112
112
|
|
|
113
113
|
|
|
114
|
-
class
|
|
114
|
+
class KeyLog:
|
|
115
115
|
"""
|
|
116
116
|
Specifies the intent for a (TLS) keylogger to be used in a client or server configuration.
|
|
117
117
|
|
|
@@ -121,9 +121,9 @@ class KeyLogPolicy:
|
|
|
121
121
|
with the correct session keys.
|
|
122
122
|
|
|
123
123
|
Static Methods:
|
|
124
|
-
environment() ->
|
|
124
|
+
environment() -> KeyLog
|
|
125
125
|
Use the SSLKEYLOGFILE environment variable for key logging.
|
|
126
|
-
file(path: Path) ->
|
|
126
|
+
file(path: Path) -> KeyLog
|
|
127
127
|
Log keys to the specified file path.
|
|
128
128
|
|
|
129
129
|
Methods:
|
|
@@ -134,14 +134,14 @@ class KeyLogPolicy:
|
|
|
134
134
|
"""
|
|
135
135
|
|
|
136
136
|
@staticmethod
|
|
137
|
-
def environment() -> "
|
|
137
|
+
def environment() -> "KeyLog":
|
|
138
138
|
"""
|
|
139
139
|
Use the SSLKEYLOGFILE environment variable for key logging.
|
|
140
140
|
"""
|
|
141
141
|
...
|
|
142
142
|
|
|
143
143
|
@staticmethod
|
|
144
|
-
def file(path: Path) -> "
|
|
144
|
+
def file(path: Path) -> "KeyLog":
|
|
145
145
|
"""
|
|
146
146
|
Log keys to the specified file path.
|
|
147
147
|
|
|
@@ -149,15 +149,3 @@ class KeyLogPolicy:
|
|
|
149
149
|
path: The file path to log TLS keys to.
|
|
150
150
|
"""
|
|
151
151
|
...
|
|
152
|
-
|
|
153
|
-
def is_environment(self) -> bool:
|
|
154
|
-
"""
|
|
155
|
-
Returns True if this policy uses the environment variable.
|
|
156
|
-
"""
|
|
157
|
-
...
|
|
158
|
-
|
|
159
|
-
def is_file(self) -> bool:
|
|
160
|
-
"""
|
|
161
|
-
Returns True if this policy logs to a specific file.
|
|
162
|
-
"""
|
|
163
|
-
...
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rnet
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.0rc6
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -44,13 +44,12 @@ A blazing-fast Python HTTP client with advanced browser fingerprinting that accu
|
|
|
44
44
|
- Plain bodies, JSON, urlencoded, multipart
|
|
45
45
|
- Cookie Store
|
|
46
46
|
- Redirect Policy
|
|
47
|
-
- Original
|
|
47
|
+
- Original Headers
|
|
48
48
|
- Rotating Proxies
|
|
49
|
+
- WebSocket Upgrade
|
|
49
50
|
- Connection Pooling
|
|
50
51
|
- Streaming Transfers
|
|
51
52
|
- Zero-Copy Transfers
|
|
52
|
-
- WebSocket Upgrade
|
|
53
|
-
- Async DNS Resolver
|
|
54
53
|
- HTTPS via BoringSSL
|
|
55
54
|
- Free-Threaded Safety
|
|
56
55
|
- Automatic Decompression
|
|
@@ -60,14 +59,14 @@ A blazing-fast Python HTTP client with advanced browser fingerprinting that accu
|
|
|
60
59
|
The following example uses the `asyncio` runtime with `rnet` installed via pip:
|
|
61
60
|
|
|
62
61
|
```bash
|
|
63
|
-
pip install asyncio rnet==3.0.
|
|
62
|
+
pip install asyncio rnet==3.0.0rc6
|
|
64
63
|
```
|
|
65
64
|
|
|
66
65
|
And then the code:
|
|
67
66
|
|
|
68
67
|
```python
|
|
69
68
|
import asyncio
|
|
70
|
-
from rnet import
|
|
69
|
+
from rnet import Client, Emulation
|
|
71
70
|
|
|
72
71
|
|
|
73
72
|
async def main():
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
rnet-3.0.0rc6.dist-info/METADATA,sha256=GLq934lBuJCkfF696Axso1pB1X_NA93pQF7OF7qGoPk,10147
|
|
2
|
+
rnet-3.0.0rc6.dist-info/WHEEL,sha256=-AnzwsCZZZo6t7GpinHDciORdL-RbdNP8PxgnJN40TU,106
|
|
3
|
+
rnet-3.0.0rc6.dist-info/licenses/LICENSE,sha256=ld2UNRYADDwfLyJ9Q34VP3bWRfS53mvK1tixHd57kN0,11357
|
|
4
|
+
rnet.libs/libgcc_s-9d4368bd.so.1,sha256=B7rWHj4RWVk9_1dl-zWKMFMZC-7BdnbvpIyAWLNQDKw,2757253
|
|
5
|
+
rnet/__init__.py,sha256=JXdQrPFE8MPaCRR4cHJ8Ev0l_zC-Qr0nfcQLSmIsErY,303
|
|
6
|
+
rnet/__init__.pyi,sha256=7hPvON_Ksfskd0soZhQklR5vnZX3MEwJSjlQby7TDec,32557
|
|
7
|
+
rnet/blocking.py,sha256=W2tTSUH1y8MVNKnFY1Zdran36hMT8Qj9rosWVyGIgBE,8747
|
|
8
|
+
rnet/cookie.py,sha256=4UYJY9jlXqe8vObXLSqzk1dFoKRO5mCnsgC0TCC4N1Y,3023
|
|
9
|
+
rnet/emulation.py,sha256=JWLvOAtvFa_xkozDinU83BFYW7G8KuEyGVDiaqjqVmQ,5064
|
|
10
|
+
rnet/exceptions.py,sha256=Rpwo1GVE2eJhFVAGJWAlsY4XypZ-i0j9Th-pnm7l_yY,5951
|
|
11
|
+
rnet/header.py,sha256=K_bp5F_4D21UjMaBp7aM-aGVYI162IsX-vn2fjExEF4,9749
|
|
12
|
+
rnet/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
rnet/rnet.abi3.so,sha256=P6TKURTs_9C9-fk6rOMN61juzdxi1jWbTJ2T5Lg9wr0,7455077
|
|
14
|
+
rnet/tls.py,sha256=3X6JtOvye1MXQQKjxZLDesu0VvVxqNew7bRGE09dUHc,4546
|
|
15
|
+
rnet-3.0.0rc6.dist-info/RECORD,,
|
rnet-3.0.0rc4.dist-info/RECORD
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
rnet-3.0.0rc4.dist-info/METADATA,sha256=2YwW2_RNLz7yzW9zGOIk_VjqkpwWNNc9tKvn1f5DtYs,10167
|
|
2
|
-
rnet-3.0.0rc4.dist-info/WHEEL,sha256=-AnzwsCZZZo6t7GpinHDciORdL-RbdNP8PxgnJN40TU,106
|
|
3
|
-
rnet-3.0.0rc4.dist-info/licenses/LICENSE,sha256=ld2UNRYADDwfLyJ9Q34VP3bWRfS53mvK1tixHd57kN0,11357
|
|
4
|
-
rnet.libs/libgcc_s-9d4368bd.so.1,sha256=B7rWHj4RWVk9_1dl-zWKMFMZC-7BdnbvpIyAWLNQDKw,2757253
|
|
5
|
-
rnet/__init__.py,sha256=-ls4I6NTnLT8vB8ST0KgphHliSJ8c_NyhrVzBa5JMJ0,277
|
|
6
|
-
rnet/__init__.pyi,sha256=mFsN8_KOvDTR2wpJ0y7eoKVyAVHPExN-6FkawwkoLm8,32440
|
|
7
|
-
rnet/blocking.py,sha256=u5P-g_FZ6jH5fqirNXsNau-ovsjkfqw8X6BpKQ_xpBM,8579
|
|
8
|
-
rnet/cookie.py,sha256=4UYJY9jlXqe8vObXLSqzk1dFoKRO5mCnsgC0TCC4N1Y,3023
|
|
9
|
-
rnet/emulation.py,sha256=JWLvOAtvFa_xkozDinU83BFYW7G8KuEyGVDiaqjqVmQ,5064
|
|
10
|
-
rnet/exceptions.py,sha256=A-3i9K-Ek4KRTap2gAI8Z7-ZMjbsOgKCikT3xWSralc,5854
|
|
11
|
-
rnet/header.py,sha256=K_bp5F_4D21UjMaBp7aM-aGVYI162IsX-vn2fjExEF4,9749
|
|
12
|
-
rnet/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
rnet/rnet.abi3.so,sha256=fL74dnSvEKai-6vdX9EExOcSxpheAdg5Pf1OrrWI5eY,7508353
|
|
14
|
-
rnet/tls.py,sha256=xTTuk3XSReGvzrTvBLyepWm3wq-bHYW-tetsX66Na3g,4853
|
|
15
|
-
rnet-3.0.0rc4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|