requests-go 0.2__tar.gz → 0.3__tar.gz
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.
- {requests_go-0.2 → requests_go-0.3}/PKG-INFO +12 -5
- {requests_go-0.2 → requests_go-0.3}/README.md +11 -4
- {requests_go-0.2 → requests_go-0.3}/requests_go/__version__.py +1 -1
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/request.py +6 -1
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_config/config.py +6 -1
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_config/extensions.py +40 -7
- {requests_go-0.2 → requests_go-0.3}/requests_go.egg-info/PKG-INFO +12 -5
- {requests_go-0.2 → requests_go-0.3}/LICENSE +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/__init__.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/api.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/pool.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/pool_provider.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/request.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/response.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/sessions.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/__init__.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/client.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/__init__.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/requests-go-amd64.so +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/requests-go-arm64.dylib +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/requests-go-arm64.so +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/requests-go-win64.dll +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/requests-go-x86.dylib +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/requests-go-x86.so +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/exceptions.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/response.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/structures.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_config/__init__.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_config/adapter.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go/tls_config/convert_config.py +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go.egg-info/SOURCES.txt +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go.egg-info/dependency_links.txt +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go.egg-info/requires.txt +0 -0
- {requests_go-0.2 → requests_go-0.3}/requests_go.egg-info/top_level.txt +0 -0
- {requests_go-0.2 → requests_go-0.3}/setup.cfg +0 -0
- {requests_go-0.2 → requests_go-0.3}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: requests_go
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3
|
|
4
4
|
Summary: Advanced Python HTTP/HTTP2 Client. Support tls/http2/ja3 Fingerprint Custom.
|
|
5
5
|
Author: Lee Gene
|
|
6
6
|
License: MIT
|
|
@@ -66,26 +66,33 @@ tls.tls_extensions.key_share_curves = [
|
|
|
66
66
|
"GREASE",
|
|
67
67
|
"X25519"
|
|
68
68
|
]
|
|
69
|
-
tls.
|
|
69
|
+
tls.http2_settings.settings = {
|
|
70
70
|
"HEADER_TABLE_SIZE": 65536,
|
|
71
71
|
"ENABLE_PUSH": 0,
|
|
72
72
|
"MAX_CONCURRENT_STREAMS": 1000,
|
|
73
73
|
"INITIAL_WINDOW_SIZE": 6291456,
|
|
74
74
|
"MAX_HEADER_LIST_SIZE": 262144
|
|
75
75
|
}
|
|
76
|
-
tls.
|
|
76
|
+
tls.http2_settings.settings_order = [
|
|
77
77
|
"HEADER_TABLE_SIZE",
|
|
78
78
|
"ENABLE_PUSH",
|
|
79
79
|
"MAX_CONCURRENT_STREAMS",
|
|
80
80
|
"INITIAL_WINDOW_SIZE",
|
|
81
81
|
"MAX_HEADER_LIST_SIZE"
|
|
82
82
|
]
|
|
83
|
-
tls.
|
|
83
|
+
tls.http2_settings.connection_flow = 15663105
|
|
84
84
|
response = requests_go.get(url=url, headers=headers, tls_config=tls)
|
|
85
|
-
|
|
85
|
+
print(response.url)
|
|
86
|
+
print(response.text)
|
|
87
|
+
print(response.headers)
|
|
88
|
+
print(response.cookies)
|
|
86
89
|
|
|
87
90
|
```
|
|
88
91
|
|
|
92
|
+
## 常见错误
|
|
93
|
+
1. `单独设置ja3报404错误`的解决方法:默认使用http2,必须搭配pseudo_header_order伪标题顺序去使用,否则会访问失败404,或force_http1强制使用http1(0.3版本会更新)。
|
|
94
|
+
2. `挂上VPN后报EOF错误`的解决方法:默认requests-go跟requests一样会去读取系统环境变量中的代理,默认代理会使用https协议,需手动修改proxies的代理为http协议即可。
|
|
95
|
+
|
|
89
96
|
`兼容requests:`
|
|
90
97
|
|
|
91
98
|
```python
|
|
@@ -47,26 +47,33 @@ tls.tls_extensions.key_share_curves = [
|
|
|
47
47
|
"GREASE",
|
|
48
48
|
"X25519"
|
|
49
49
|
]
|
|
50
|
-
tls.
|
|
50
|
+
tls.http2_settings.settings = {
|
|
51
51
|
"HEADER_TABLE_SIZE": 65536,
|
|
52
52
|
"ENABLE_PUSH": 0,
|
|
53
53
|
"MAX_CONCURRENT_STREAMS": 1000,
|
|
54
54
|
"INITIAL_WINDOW_SIZE": 6291456,
|
|
55
55
|
"MAX_HEADER_LIST_SIZE": 262144
|
|
56
56
|
}
|
|
57
|
-
tls.
|
|
57
|
+
tls.http2_settings.settings_order = [
|
|
58
58
|
"HEADER_TABLE_SIZE",
|
|
59
59
|
"ENABLE_PUSH",
|
|
60
60
|
"MAX_CONCURRENT_STREAMS",
|
|
61
61
|
"INITIAL_WINDOW_SIZE",
|
|
62
62
|
"MAX_HEADER_LIST_SIZE"
|
|
63
63
|
]
|
|
64
|
-
tls.
|
|
64
|
+
tls.http2_settings.connection_flow = 15663105
|
|
65
65
|
response = requests_go.get(url=url, headers=headers, tls_config=tls)
|
|
66
|
-
|
|
66
|
+
print(response.url)
|
|
67
|
+
print(response.text)
|
|
68
|
+
print(response.headers)
|
|
69
|
+
print(response.cookies)
|
|
67
70
|
|
|
68
71
|
```
|
|
69
72
|
|
|
73
|
+
## 常见错误
|
|
74
|
+
1. `单独设置ja3报404错误`的解决方法:默认使用http2,必须搭配pseudo_header_order伪标题顺序去使用,否则会访问失败404,或force_http1强制使用http1(0.3版本会更新)。
|
|
75
|
+
2. `挂上VPN后报EOF错误`的解决方法:默认requests-go跟requests一样会去读取系统环境变量中的代理,默认代理会使用https协议,需手动修改proxies的代理为http协议即可。
|
|
76
|
+
|
|
70
77
|
`兼容requests:`
|
|
71
78
|
|
|
72
79
|
```python
|
|
@@ -56,7 +56,12 @@ class Session:
|
|
|
56
56
|
if verify:
|
|
57
57
|
request_params["Verify"] = verify
|
|
58
58
|
if body:
|
|
59
|
-
|
|
59
|
+
if type(body) == str:
|
|
60
|
+
request_params["Body"] = body
|
|
61
|
+
elif type(body) == bytes:
|
|
62
|
+
request_params["Body"] = body.decode()
|
|
63
|
+
else:
|
|
64
|
+
raise TLSClientExeption("Body data is not a string or bytes class.")
|
|
60
65
|
elif data:
|
|
61
66
|
request_params["Data"] = data
|
|
62
67
|
elif json:
|
|
@@ -26,7 +26,12 @@ class TLSConfig:
|
|
|
26
26
|
# ":scheme",
|
|
27
27
|
# ":path"
|
|
28
28
|
# ]
|
|
29
|
-
self.pseudo_header_order: list[str] =
|
|
29
|
+
self.pseudo_header_order: list[str] = [
|
|
30
|
+
":method",
|
|
31
|
+
":authority",
|
|
32
|
+
":scheme",
|
|
33
|
+
":path"
|
|
34
|
+
] # HTTP2 Pseudo header order
|
|
30
35
|
self.tls_extensions: TLSExtensions = TLSExtensions() # tls extensions
|
|
31
36
|
self.http2_settings: HTTP2Settings = HTTP2Settings() # http2 extensions
|
|
32
37
|
|
|
@@ -155,7 +155,12 @@ class TLSExtensions:
|
|
|
155
155
|
# "0x402",
|
|
156
156
|
# "0x302",
|
|
157
157
|
# ]
|
|
158
|
-
self.supported_delegated_credentials_algorithms: list[str] =
|
|
158
|
+
self.supported_delegated_credentials_algorithms: list[str] = [
|
|
159
|
+
"ECDSAWithP256AndSHA256",
|
|
160
|
+
"ECDSAWithP384AndSHA384",
|
|
161
|
+
"ECDSAWithP521AndSHA512",
|
|
162
|
+
"ECDSAWithSHA1",
|
|
163
|
+
] # Supported Delegated Voucher Algorithms
|
|
159
164
|
# GREASE
|
|
160
165
|
# 1.3
|
|
161
166
|
# 1.2
|
|
@@ -177,7 +182,9 @@ class TLSExtensions:
|
|
|
177
182
|
# [
|
|
178
183
|
# "PskModeDHE",
|
|
179
184
|
# ]
|
|
180
|
-
self.psk_key_exchange_modes: list[str] =
|
|
185
|
+
self.psk_key_exchange_modes: list[str] = [
|
|
186
|
+
"PskModeDHE"
|
|
187
|
+
] # PSK Key Exchange Modes
|
|
181
188
|
# PKCS1WithSHA256
|
|
182
189
|
# PKCS1WithSHA384
|
|
183
190
|
# PKCS1WithSHA512
|
|
@@ -240,7 +247,19 @@ class TLSExtensions:
|
|
|
240
247
|
# "0x402",
|
|
241
248
|
# "0x302",
|
|
242
249
|
# ]
|
|
243
|
-
self.signature_algorithms_cert: list[str] =
|
|
250
|
+
self.signature_algorithms_cert: list[str] = [
|
|
251
|
+
"ECDSAWithP256AndSHA256",
|
|
252
|
+
"ECDSAWithP384AndSHA384",
|
|
253
|
+
"ECDSAWithP521AndSHA512",
|
|
254
|
+
"PSSWithSHA256",
|
|
255
|
+
"PSSWithSHA384",
|
|
256
|
+
"PSSWithSHA512",
|
|
257
|
+
"PKCS1WithSHA256",
|
|
258
|
+
"PKCS1WithSHA384",
|
|
259
|
+
"PKCS1WithSHA512",
|
|
260
|
+
"ECDSAWithSHA1",
|
|
261
|
+
"PKCS1WithSHA1",
|
|
262
|
+
] # Signature Algorithms Cert
|
|
244
263
|
# GREASE
|
|
245
264
|
# P256
|
|
246
265
|
# P384
|
|
@@ -317,7 +336,12 @@ class HTTP2Settings:
|
|
|
317
336
|
# "INITIAL_WINDOW_SIZE": 6291456,
|
|
318
337
|
# "MAX_HEADER_LIST_SIZE": 262144
|
|
319
338
|
# }
|
|
320
|
-
self.settings: dict[str, int] =
|
|
339
|
+
self.settings: dict[str, int] = {
|
|
340
|
+
"HEADER_TABLE_SIZE": 65536,
|
|
341
|
+
"MAX_CONCURRENT_STREAMS": 1000,
|
|
342
|
+
"INITIAL_WINDOW_SIZE": 6291456,
|
|
343
|
+
"MAX_HEADER_LIST_SIZE": 262144
|
|
344
|
+
} # HTTP2 Header Frame Settings
|
|
321
345
|
# HEADER_TABLE_SIZE
|
|
322
346
|
# ENABLE_PUSH
|
|
323
347
|
# MAX_CONCURRENT_STREAMS
|
|
@@ -331,8 +355,13 @@ class HTTP2Settings:
|
|
|
331
355
|
# "INITIAL_WINDOW_SIZE",
|
|
332
356
|
# "MAX_HEADER_LIST_SIZE",
|
|
333
357
|
# ]
|
|
334
|
-
self.settings_order: list[str] =
|
|
335
|
-
|
|
358
|
+
self.settings_order: list[str] = [
|
|
359
|
+
"HEADER_TABLE_SIZE",
|
|
360
|
+
"MAX_CONCURRENT_STREAMS",
|
|
361
|
+
"INITIAL_WINDOW_SIZE",
|
|
362
|
+
"MAX_HEADER_LIST_SIZE"
|
|
363
|
+
] # HTTP2 Header Frame Setting Order
|
|
364
|
+
self.connection_flow: int = 15663105 # HTTP2 Window Update increment
|
|
336
365
|
# Header Priority
|
|
337
366
|
# Example:
|
|
338
367
|
# {
|
|
@@ -340,7 +369,11 @@ class HTTP2Settings:
|
|
|
340
369
|
# "exclusive": true,
|
|
341
370
|
# "weight": 1
|
|
342
371
|
# }
|
|
343
|
-
self.header_priority: dict[str, any] =
|
|
372
|
+
self.header_priority: dict[str, any] = {
|
|
373
|
+
"streamDep": 0,
|
|
374
|
+
"exclusive": True,
|
|
375
|
+
"weight": 256
|
|
376
|
+
} # HTTP2 Header Priority
|
|
344
377
|
# Example:
|
|
345
378
|
# [
|
|
346
379
|
# {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: requests-go
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3
|
|
4
4
|
Summary: Advanced Python HTTP/HTTP2 Client. Support tls/http2/ja3 Fingerprint Custom.
|
|
5
5
|
Author: Lee Gene
|
|
6
6
|
License: MIT
|
|
@@ -66,26 +66,33 @@ tls.tls_extensions.key_share_curves = [
|
|
|
66
66
|
"GREASE",
|
|
67
67
|
"X25519"
|
|
68
68
|
]
|
|
69
|
-
tls.
|
|
69
|
+
tls.http2_settings.settings = {
|
|
70
70
|
"HEADER_TABLE_SIZE": 65536,
|
|
71
71
|
"ENABLE_PUSH": 0,
|
|
72
72
|
"MAX_CONCURRENT_STREAMS": 1000,
|
|
73
73
|
"INITIAL_WINDOW_SIZE": 6291456,
|
|
74
74
|
"MAX_HEADER_LIST_SIZE": 262144
|
|
75
75
|
}
|
|
76
|
-
tls.
|
|
76
|
+
tls.http2_settings.settings_order = [
|
|
77
77
|
"HEADER_TABLE_SIZE",
|
|
78
78
|
"ENABLE_PUSH",
|
|
79
79
|
"MAX_CONCURRENT_STREAMS",
|
|
80
80
|
"INITIAL_WINDOW_SIZE",
|
|
81
81
|
"MAX_HEADER_LIST_SIZE"
|
|
82
82
|
]
|
|
83
|
-
tls.
|
|
83
|
+
tls.http2_settings.connection_flow = 15663105
|
|
84
84
|
response = requests_go.get(url=url, headers=headers, tls_config=tls)
|
|
85
|
-
|
|
85
|
+
print(response.url)
|
|
86
|
+
print(response.text)
|
|
87
|
+
print(response.headers)
|
|
88
|
+
print(response.cookies)
|
|
86
89
|
|
|
87
90
|
```
|
|
88
91
|
|
|
92
|
+
## 常见错误
|
|
93
|
+
1. `单独设置ja3报404错误`的解决方法:默认使用http2,必须搭配pseudo_header_order伪标题顺序去使用,否则会访问失败404,或force_http1强制使用http1(0.3版本会更新)。
|
|
94
|
+
2. `挂上VPN后报EOF错误`的解决方法:默认requests-go跟requests一样会去读取系统环境变量中的代理,默认代理会使用https协议,需手动修改proxies的代理为http协议即可。
|
|
95
|
+
|
|
89
96
|
`兼容requests:`
|
|
90
97
|
|
|
91
98
|
```python
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/requests-go-amd64.so
RENAMED
|
File without changes
|
{requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/requests-go-arm64.dylib
RENAMED
|
File without changes
|
{requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/requests-go-arm64.so
RENAMED
|
File without changes
|
{requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/requests-go-win64.dll
RENAMED
|
File without changes
|
{requests_go-0.2 → requests_go-0.3}/requests_go/tls_client/dependencies/requests-go-x86.dylib
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|