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