26 lines
1.1 KiB
Python
26 lines
1.1 KiB
Python
import json, urllib.parse, requests, concurrent.futures as cf
|
|
acc=[json.loads(l) for l in open(r"C:\Users\User\tmp\decodo_autoreg\data\accounts.jsonl",encoding='utf-8') if l.strip()]
|
|
cand=[]
|
|
for a in acc:
|
|
u,p,h=a.get('proxy_username'),a.get('proxy_password'),a.get('proxy_host')
|
|
if not (u and p and h): continue
|
|
pw=urllib.parse.quote(p,safe='~')
|
|
for port in range(10000,10010):
|
|
cand.append("%s:%s@%s:%d"%(u,pw,h,port))
|
|
cand=list(dict.fromkeys(cand))
|
|
def t(px):
|
|
P={"http":"http://"+px,"https":"http://"+px}
|
|
try:
|
|
r=requests.get("https://freemodel.in/register",proxies=P,timeout=20,headers={"User-Agent":"Mozilla/5.0"})
|
|
if 'name="_token"' not in r.text: return None
|
|
ip=requests.get("https://api.ipify.org",proxies=P,timeout=15).text.strip()
|
|
return (px,ip)
|
|
except Exception: return None
|
|
good=[]
|
|
with cf.ThreadPoolExecutor(25) as ex:
|
|
for r in ex.map(t,cand):
|
|
if r: good.append(r)
|
|
print("cand",len(cand),"good",len(good))
|
|
for g in good[:5]: print(g[1], g[0][:60])
|
|
open("px_decodo2.txt","w").write("\n".join(g[0] for g in good))
|