Update 'main.py'

main
ramjm 6 months ago
parent e68a10a207
commit 6a2932eb19

@ -9,20 +9,24 @@ headers = {
} }
# набор символов для генерации # набор символов для генерации
alf = "0123456789" alf = "abcdefghijklmnopqrstuvwxyz0123456789"
def main():
with open("domens.txt", "w") as f: with open("domens.txt", "a") as f:
# тут 3 цикла, для генерации 3-хсимвольного домена, а далее проверки на "is_available" # тут 3 цикла, для генерации 3-хсимвольного домена, а далее проверки на "is_available"
for x1 in alf: for x1 in alf:
for x2 in alf: for x2 in alf:
for x3 in alf: for x3 in alf:
json_data = { json_data = {'domainList': f'["{x1+x2+x3}.pw"]'}
'domainList': f'["{x1+x2+x3}.pw"]', try:
}
response = requests.post('https://2domains.ru/wizard/api/domain/check', headers=headers, json=json_data).json()[0] response = requests.post('https://2domains.ru/wizard/api/domain/check', headers=headers, json=json_data).json()[0]
if (response["is_available"] == True): if (response["is_available"] == True):
f.write(f'{response["domain"]} - {response["price"]}\n') f.write(f'{response["domain"]} - {response["price"]}\n')
print(f'{response["domain"]} - {response["price"]}') print(f'{response["domain"]} - {response["price"]}')
except:
pass
f.write("==== DONE ====")
if __name__ == "__main__":
main()
Loading…
Cancel
Save