-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmergeServers.py
60 lines (46 loc) · 1.54 KB
/
mergeServers.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
import requests
import time
url=['https://proxypool.laowang.me/clash/proxies',
'https://proxypool.toshiki.top/clash/proxies',
'https://klausvpn.posyao.com/clash/proxies',
'https://fq.lonxin.net/clash/proxies',
'https://proxies.bihai.cf/clash/proxies',
'http://wxshi.top:9090/clash/proxies',
'https://www.sdufe.tk/clash/proxies',
'https://proxy.yugogo.xyz/clash/proxies',
'https://free.dswang.ga/clash/proxies',
'http://clash.3wking.com:12580/clash/proxies'
]
outlist=[]
urlIndex=0
for urlItem in url:
servercount=0
try:
response = requests.get(urlItem,timeout=60)
except:
pass
allservers = response.text
Lines = allservers.split("\n")
servercount=len(Lines)
outlist.extend(Lines)
urlIndex+=1
print(" link " ,urlIndex," found " , servercount ," servers")
allservers=""
result = []
for item in outlist:
try:
servername=item.split('server":"')[1].split('"')[0]
serverport=item.split('port":')[1].split(',')[0]
serverpass=item.split('password":')[1].split('"')[1]
if not any((servername in s and serverport in s and serverpass in s) for s in result):
result.append(item)
servercount+=1
print(" server no ", servercount, "--->",servername,":", serverport," pass : ", serverpass)
except:
pass
file1 = open("./allservers.txt", "w", encoding="utf8")
file1.write("proxies:" + "\n")
for element in result:
file1.write(element + "\n")
file1.close()
time.sleep(10)