You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import requests # импортируем модуль requests
# заголовки
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0',
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
'Content-Type': 'application/json',
}
# набор символов для генерации
alf = "0123456789"
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"]',
}
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"]}')