Created
June 25, 2024 19:57
-
-
Save mb6ockatf/9dc34999dc748855eead1bd834b88945 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from requests import post | |
from itertools import permutations | |
from string import ascii_lowercase, digits | |
import sys | |
from telethon import TelegramClient | |
from telethon.tl.functions.users import GetFullUserRequest | |
import asyncio | |
async def check_uname(username, client): | |
try: | |
temp = await client(GetFullUserRequest(username)) | |
# print(f'Username "{username}" is already taken') | |
return | |
except Exception as e: # Заменяем на общее исключение | |
print(f'Username "{username}" is free!') | |
return | |
async def main(): | |
api_id = "" # замени на свой | |
api_hash = "" # замени на свой | |
client = TelegramClient('bot', api_id, api_hash) | |
await client.connect() | |
data = ascii_lowercase | |
for attempt in permutations(data, r=4): | |
r = "c" + "".join(attempt) | |
async with client: | |
await check_uname(r, client) | |
if __name__ == '__main__': # Исправляем условие на вход в точку входа | |
asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment