-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
49 lines (41 loc) · 1.15 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from pyrogram import Client
from pyrogram.raw import functions
import asyncio
import requests
from bs4 import BeautifulSoup
from time import sleep
from config import *
# Get 5000 most popular words in english
x = BeautifulSoup(requests.get('https://studynow.ru/dicta/allwords').text, "html.parser")
y = x.text.split("\n")
z = []
for i in y:
if i != "" and '0' <= i[0] <= '9' and not i.count('5000'):
tmp = ""
for j in i:
if "a" <= j <= "z":
tmp += j
if len(tmp) >= 5:
z.append(tmp)
print(z)
# Checker for each word
async def test():
async with Client("my_account2", api_id=configID, api_hash=configHASH) as app:
for i in z:
try:
r = await app.invoke(
functions.account.CheckUsername(
username=i
)
)
if r:
print(str(r) + " " + i)
except:
'400 USERNAME_INVALID'
sleep(5)
def main():
loop = asyncio.get_event_loop()
loop.run_until_complete(test())
loop.close()
if __name__ == '__main__':
main()