This repository was archived by the owner on May 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest_script.py
146 lines (122 loc) · 3.84 KB
/
test_script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
from asyncio import run
from time import time
import proxygrab
class Test:
"""Testing some minor api commands"""
@staticmethod
async def run_all():
print("Starting test...")
start = time()
success = 0
try:
p1 = await proxygrab.get_http()
success += 1
print("HTTP:", len(p1))
except Exception as ef:
print("Error:", ef)
try:
p2 = await proxygrab.get_https()
success += 1
print("HTTPS:", len(p2))
except Exception as ef:
print("Error:", ef)
try:
p3 = await proxygrab.get_socks4()
success += 1
print("SOCKS4:", len(p3))
except Exception as ef:
print("Error:", ef)
try:
p4 = await proxygrab.get_socks5()
success += 1
print("SOCKS5:", len(p4))
except Exception as ef:
print("Error:", ef)
try:
p5 = await proxygrab.get_proxy("http")
success += 1
print("HTTP(GetProxyM):", len(p5))
except Exception as ef:
print("Error:", ef)
try:
p6 = await proxygrab.get_proxy("https")
success += 1
print("HTTPS(GetProxyM):", len(p6))
except Exception as ef:
print("Error:", ef)
try:
p7 = await proxygrab.get_proxy("socks4")
success += 1
print("SOCKS4(GetProxyM):", len(p7))
except Exception as ef:
print("Error:", ef)
try:
p8 = await proxygrab.get_proxy("socks5")
success += 1
print("SOCKS5(GetProxyM):", len(p8))
except Exception as ef:
print("Error:", ef)
try:
g = await proxygrab.get_all_proxies()
success += 1
print("All(GetProxyM):", len(g))
except Exception as ef:
print("Error:", ef)
try:
s = await proxygrab.save_all_proxies()
success += 1
print(f"Saved all proxies to {s}")
except Exception as ef:
print("Error:", ef)
try:
p1 = await proxygrab.save_http()
success += 1
print("Saved http proxies")
except Exception as ef:
print("Error:", ef)
try:
p2 = await proxygrab.save_https()
success += 1
print("Saved https proxies")
except Exception as ef:
print("Error:", ef)
try:
p3 = await proxygrab.save_socks4()
success += 1
print("Saved socks4 proxies")
except Exception as ef:
print("Error:", ef)
try:
p4 = await proxygrab.save_socks5()
success += 1
print("Saved socks5 proxies")
except Exception as ef:
print("Error:", ef)
try:
p5 = await proxygrab.save_proxy("http")
success += 1
print("Saved http SaveM proxies")
except Exception as ef:
print("Error:", ef)
try:
p6 = await proxygrab.save_proxy("https")
success += 1
print("Saved https SaveM proxies")
except Exception as ef:
print("Error:", ef)
try:
p7 = await proxygrab.save_proxy("socks4")
success += 1
print("Saved socks4 SaveM proxies")
except Exception as ef:
print("Error:", ef)
try:
p8 = await proxygrab.save_proxy("socks5")
success += 1
print("Saved socks5 SaveM proxies")
except Exception as ef:
print("Error:", ef)
end = time()
print(f"Total Tests done: {success}")
print(f"Time Taken for running the test: {round(end-start,3)}s")
run(Test.run_all())