notify-tls-client 0.1.6__py3-none-any.whl → 0.1.9__py3-none-any.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.
- notify_tls_client/__init__.py +2 -2
- notify_tls_client/core/client/__init__.py +1 -6
- notify_tls_client/core/client/decorators.py +239 -90
- notify_tls_client/core/client_identifiers_manager.py +45 -0
- notify_tls_client/core/notifytlsclient.py +196 -146
- notify_tls_client/core/proxiesmanager/__init__.py +1 -1
- notify_tls_client/core/proxiesmanager/proxiesmanager.py +67 -67
- notify_tls_client/core/proxiesmanager/proxiesmanagerloader.py +33 -33
- notify_tls_client/tls_client/__init__.py +14 -14
- notify_tls_client/tls_client/__version__.py +10 -10
- notify_tls_client/tls_client/cffi.py +38 -62
- notify_tls_client/tls_client/cookies.py +456 -456
- notify_tls_client/tls_client/dependencies/{tls-client-xgo-1.11.0-darwin-arm64.dylib → tls-client-darwin-amd64-1.12.0.dylib} +0 -0
- notify_tls_client/tls_client/dependencies/tls-client-linux-arm64-1.12.0.so +0 -0
- notify_tls_client/tls_client/dependencies/{tls-client-xgo-1.11.0-linux-amd64.so → tls-client-linux-ubuntu-amd64-1.12.0.so} +0 -0
- notify_tls_client/tls_client/dependencies/{tls-client-windows-1.11.0-64.dll → tls-client-windows-64-1.12.0.dll} +0 -0
- notify_tls_client/tls_client/exceptions.py +2 -2
- notify_tls_client/tls_client/response.py +83 -78
- notify_tls_client/tls_client/sessions.py +522 -513
- notify_tls_client/tls_client/settings.py +69 -69
- notify_tls_client/tls_client/structures.py +74 -74
- {notify_tls_client-0.1.6.dist-info → notify_tls_client-0.1.9.dist-info}/METADATA +14 -16
- notify_tls_client-0.1.9.dist-info/RECORD +27 -0
- notify_tls_client-0.1.6.dist-info/RECORD +0 -25
- {notify_tls_client-0.1.6.dist-info → notify_tls_client-0.1.9.dist-info}/WHEEL +0 -0
- {notify_tls_client-0.1.6.dist-info → notify_tls_client-0.1.9.dist-info}/top_level.txt +0 -0
|
@@ -1,62 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
from sys import platform
|
|
3
|
-
from platform import machine
|
|
4
|
-
import ctypes
|
|
5
|
-
import os
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
elif
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
# Encontre o primeiro arquivo que termina com o file_ext
|
|
40
|
-
for filename in os.listdir(lib_dir):
|
|
41
|
-
if filename.endswith(file_ext):
|
|
42
|
-
lib_path = os.path.join(lib_dir, filename)
|
|
43
|
-
break
|
|
44
|
-
|
|
45
|
-
if not lib_path:
|
|
46
|
-
raise FileNotFoundError(f"No shared library found in {lib_dir} with extension {file_ext}")
|
|
47
|
-
|
|
48
|
-
root_dir = os.path.abspath(os.path.dirname(__file__))
|
|
49
|
-
library = ctypes.cdll.LoadLibrary(lib_path)
|
|
50
|
-
|
|
51
|
-
# extract the exposed request function from the shared package
|
|
52
|
-
request = library.request
|
|
53
|
-
request.argtypes = [ctypes.c_char_p]
|
|
54
|
-
request.restype = ctypes.c_char_p
|
|
55
|
-
|
|
56
|
-
freeMemory = library.freeMemory
|
|
57
|
-
freeMemory.argtypes = [ctypes.c_char_p]
|
|
58
|
-
freeMemory.restype = ctypes.c_char_p
|
|
59
|
-
|
|
60
|
-
destroySession = library.destroySession
|
|
61
|
-
destroySession.argtypes = [ctypes.c_char_p]
|
|
62
|
-
destroySession.restype = ctypes.c_char_p
|
|
1
|
+
from glob import glob
|
|
2
|
+
from sys import platform
|
|
3
|
+
from platform import machine
|
|
4
|
+
import ctypes
|
|
5
|
+
import os
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
if platform == 'darwin':
|
|
9
|
+
file_ext = '-arm64-*.dylib' if machine() == "arm64" else '-x86-*.dylib'
|
|
10
|
+
elif platform in ('win32', 'cygwin'):
|
|
11
|
+
file_ext = '*-64-*.dll' if 8 == ctypes.sizeof(ctypes.c_voidp) else '*-32-*.dll'
|
|
12
|
+
else:
|
|
13
|
+
if machine() == "aarch64":
|
|
14
|
+
file_ext = '-arm64-*.so'
|
|
15
|
+
elif "x86" in machine():
|
|
16
|
+
file_ext = '-x86-*.so'
|
|
17
|
+
else:
|
|
18
|
+
file_ext = '-amd64-*.so'
|
|
19
|
+
|
|
20
|
+
root_dir = os.path.abspath(os.path.dirname(__file__))
|
|
21
|
+
matches = glob(f'{root_dir}/dependencies/tls-client{file_ext}')
|
|
22
|
+
if not matches:
|
|
23
|
+
raise FileNotFoundError(f'No tls-client library found for the current platform: {platform} {machine()}')
|
|
24
|
+
|
|
25
|
+
library = ctypes.cdll.LoadLibrary(matches[0])
|
|
26
|
+
|
|
27
|
+
# extract the exposed request function from the shared package
|
|
28
|
+
request = library.request
|
|
29
|
+
request.argtypes = [ctypes.c_char_p]
|
|
30
|
+
request.restype = ctypes.c_char_p
|
|
31
|
+
|
|
32
|
+
freeMemory = library.freeMemory
|
|
33
|
+
freeMemory.argtypes = [ctypes.c_char_p]
|
|
34
|
+
freeMemory.restype = ctypes.c_char_p
|
|
35
|
+
|
|
36
|
+
destroySession = library.destroySession
|
|
37
|
+
destroySession.argtypes = [ctypes.c_char_p]
|
|
38
|
+
destroySession.restype = ctypes.c_char_p
|