isrpa 0.1__py3-none-any.whl → 0.2__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.
- isrpa/__init__.py +1 -0
- wzjpkg/isrpaUtil.py → isrpa/utils.py +78 -78
- {isrpa-0.1.dist-info → isrpa-0.2.dist-info}/METADATA +1 -1
- isrpa-0.2.dist-info/RECORD +6 -0
- isrpa-0.2.dist-info/top_level.txt +1 -0
- isrpa-0.1.dist-info/RECORD +0 -6
- isrpa-0.1.dist-info/top_level.txt +0 -1
- wzjpkg/__init__.py +0 -1
- {isrpa-0.1.dist-info → isrpa-0.2.dist-info}/WHEEL +0 -0
isrpa/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
from .utils import *
|
@@ -1,78 +1,78 @@
|
|
1
|
-
import json
|
2
|
-
import os
|
3
|
-
|
4
|
-
import requests
|
5
|
-
|
6
|
-
|
7
|
-
def getUrl(port="9002"):
|
8
|
-
"""
|
9
|
-
环境变量设置
|
10
|
-
windows
|
11
|
-
setx ipAddress "192.168.12.249"
|
12
|
-
|
13
|
-
linux
|
14
|
-
export ipAddress = "192.168.12.249"
|
15
|
-
source /etc/profile
|
16
|
-
:param port:
|
17
|
-
:return:
|
18
|
-
"""
|
19
|
-
|
20
|
-
ip_address = os.environ.get("ipAddress", "192.168.12.249")
|
21
|
-
|
22
|
-
return "ws://" + ip_address + ":" + port
|
23
|
-
|
24
|
-
|
25
|
-
def upload_file(file_path, dic_path, port: str):
|
26
|
-
"""
|
27
|
-
通知客户端上传文件
|
28
|
-
:param file_path:
|
29
|
-
:param dic_path:
|
30
|
-
:param port:
|
31
|
-
:return:
|
32
|
-
"""
|
33
|
-
|
34
|
-
path = os.environ.get("ipAddress", "192.168.12.249")
|
35
|
-
url = "http://" + path + "/isrpa/executeCmd"
|
36
|
-
print(url)
|
37
|
-
headers = {
|
38
|
-
'Content-Type': 'application/json', # 说明请求体是 JSON 格式
|
39
|
-
}
|
40
|
-
cmd_str = "proxy_manager_cli upload --port " + port + " --localfile " + file_path + " --destfile" + dic_path
|
41
|
-
# 请求体的数据
|
42
|
-
data = {
|
43
|
-
'cmd_str': cmd_str
|
44
|
-
}
|
45
|
-
print(data)
|
46
|
-
requests.post(url, headers=headers, json=data)
|
47
|
-
|
48
|
-
|
49
|
-
def vCode(image: str, code_type, apiKey, secretKey):
|
50
|
-
"""
|
51
|
-
ocr 识别图片验证码
|
52
|
-
:param image: 图片base64
|
53
|
-
:param code_type: 8000
|
54
|
-
:param apiKey:
|
55
|
-
:param secretKey:
|
56
|
-
:return:
|
57
|
-
"""
|
58
|
-
url = "https://ai.i-search.com.cn/ocr/v2/vCode"
|
59
|
-
print(url)
|
60
|
-
headers = {
|
61
|
-
'Content-Type': 'application/json', # 说明请求体是 JSON 格式
|
62
|
-
}
|
63
|
-
|
64
|
-
# 请求体的数据
|
65
|
-
data = {
|
66
|
-
'image': image,
|
67
|
-
'code_type': code_type,
|
68
|
-
'apiKey': apiKey,
|
69
|
-
'secretKey': secretKey
|
70
|
-
}
|
71
|
-
print(data)
|
72
|
-
response = requests.post(url, headers=headers, json=data)
|
73
|
-
status_code = response.status_code
|
74
|
-
if status_code != 200:
|
75
|
-
print("请求失败,状态码:", status_code)
|
76
|
-
return {"error_msg": "failure", "error_code": status_code}
|
77
|
-
|
78
|
-
return response.json()
|
1
|
+
import json
|
2
|
+
import os
|
3
|
+
|
4
|
+
import requests
|
5
|
+
|
6
|
+
|
7
|
+
def getUrl(port="9002"):
|
8
|
+
"""
|
9
|
+
环境变量设置
|
10
|
+
windows
|
11
|
+
setx ipAddress "192.168.12.249"
|
12
|
+
|
13
|
+
linux
|
14
|
+
export ipAddress = "192.168.12.249"
|
15
|
+
source /etc/profile
|
16
|
+
:param port:
|
17
|
+
:return:
|
18
|
+
"""
|
19
|
+
|
20
|
+
ip_address = os.environ.get("ipAddress", "192.168.12.249")
|
21
|
+
|
22
|
+
return "ws://" + ip_address + ":" + port
|
23
|
+
|
24
|
+
|
25
|
+
def upload_file(file_path, dic_path, port: str):
|
26
|
+
"""
|
27
|
+
通知客户端上传文件
|
28
|
+
:param file_path:
|
29
|
+
:param dic_path:
|
30
|
+
:param port:
|
31
|
+
:return:
|
32
|
+
"""
|
33
|
+
|
34
|
+
path = os.environ.get("ipAddress", "192.168.12.249")
|
35
|
+
url = "http://" + path + "/isrpa/executeCmd"
|
36
|
+
print(url)
|
37
|
+
headers = {
|
38
|
+
'Content-Type': 'application/json', # 说明请求体是 JSON 格式
|
39
|
+
}
|
40
|
+
cmd_str = "proxy_manager_cli upload --port " + port + " --localfile " + file_path + " --destfile" + dic_path
|
41
|
+
# 请求体的数据
|
42
|
+
data = {
|
43
|
+
'cmd_str': cmd_str
|
44
|
+
}
|
45
|
+
print(data)
|
46
|
+
requests.post(url, headers=headers, json=data)
|
47
|
+
|
48
|
+
|
49
|
+
def vCode(image: str, code_type, apiKey, secretKey):
|
50
|
+
"""
|
51
|
+
ocr 识别图片验证码
|
52
|
+
:param image: 图片base64
|
53
|
+
:param code_type: 8000
|
54
|
+
:param apiKey:
|
55
|
+
:param secretKey:
|
56
|
+
:return:
|
57
|
+
"""
|
58
|
+
url = "https://ai.i-search.com.cn/ocr/v2/vCode"
|
59
|
+
print(url)
|
60
|
+
headers = {
|
61
|
+
'Content-Type': 'application/json', # 说明请求体是 JSON 格式
|
62
|
+
}
|
63
|
+
|
64
|
+
# 请求体的数据
|
65
|
+
data = {
|
66
|
+
'image': image,
|
67
|
+
'code_type': code_type,
|
68
|
+
'apiKey': apiKey,
|
69
|
+
'secretKey': secretKey
|
70
|
+
}
|
71
|
+
print(data)
|
72
|
+
response = requests.post(url, headers=headers, json=data)
|
73
|
+
status_code = response.status_code
|
74
|
+
if status_code != 200:
|
75
|
+
print("请求失败,状态码:", status_code)
|
76
|
+
return {"error_msg": "failure", "error_code": status_code}
|
77
|
+
|
78
|
+
return response.json()
|
@@ -0,0 +1,6 @@
|
|
1
|
+
isrpa/__init__.py,sha256=pG-YPVG0gJIJ6s4xcAz9S_CnUxpUcz33wl9eNUSgxGk,20
|
2
|
+
isrpa/utils.py,sha256=xvAX4rO9ogOcJ3rIXLh6q4gcuv36Ejf-BppSIAVT3b0,1950
|
3
|
+
isrpa-0.2.dist-info/METADATA,sha256=H-5EOw_Q-PCkA00sR5QdX88tRfvYm84mXNZnVL9voGI,399
|
4
|
+
isrpa-0.2.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
5
|
+
isrpa-0.2.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
|
6
|
+
isrpa-0.2.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
isrpa
|
isrpa-0.1.dist-info/RECORD
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
wzjpkg/__init__.py,sha256=NWxILkqV26Ba9ll5F5nAJ8nnb4UK9tBdDSGEWhjUXv8,24
|
2
|
-
wzjpkg/isrpaUtil.py,sha256=ft0btCNEOTqR-NVVR-cddWHQEuC5pTHxEQ10CA3RqG0,1872
|
3
|
-
isrpa-0.1.dist-info/METADATA,sha256=wlTcL9OHQ2SuM7ZZe9Uv1JjKYDC9dLc4txP2h9hJc_Q,399
|
4
|
-
isrpa-0.1.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
5
|
-
isrpa-0.1.dist-info/top_level.txt,sha256=F3fZTB80zQZiQA5Q_0yfY6LoyLFd5JYhrMxzZv3VR4g,7
|
6
|
-
isrpa-0.1.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
wzjpkg
|
wzjpkg/__init__.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
from .isrpaUtil import *
|
File without changes
|