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:
|
||||
# тут 3 цикла, для генерации 3-хсимвольного домена, а далее проверки на "is_available"
|
||||
for x1 in alf:
|
||||
for x2 in alf:
|
||||
for x3 in alf:
|
||||
json_data = {'domainList': f'["{x1+x2+x3}.pw"]'}
|
||||
try:
|
||||
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"]}')
|
||||
except:
|
||||
pass
|
||||
f.write("==== DONE ====")
|
||||
|
||||
json_data = {
|
||||
'domainList': f'["{x1+x2+x3}.pw"]',
|
||||
}
|
||||
|
||||
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"]}')
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Reference in New Issue
Block a user