From 939cc10a39f637aaae8db3e6212353a2452fd501 Mon Sep 17 00:00:00 2001 From: ramjm Date: Wed, 24 Apr 2024 21:46:37 +0300 Subject: [PATCH] Add 'main.py' --- main.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..a360f4f --- /dev/null +++ b/main.py @@ -0,0 +1,28 @@ +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"]}') + print(f'{response["domain"]} - {response["price"]}') \ No newline at end of file