Notes
Notes - notes.io |
import aiohttp
from typing import List
from os import system
def open_file() -> List[str]:
with open('usernames.txt', 'r', encoding='UTF-8') as f:
file_contents = [line.strip('n') for line in f]
return file_contents
def write_file(arg: str) -> None:
with open('hits.txt', 'a', encoding='UTF-8') as f:
f.write(f'{arg}n')
class Checker:
HEADERS = {'user-agent': 'Mozilla/5.0 (Linux; Android 12; SM-M215F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.40 Mobile Safari/537.36'}
def __init__(self, usernames: List[str]):
self.to_check = usernames
#self.count = 0
async def _check(self, session: aiohttp.ClientSession, username: str) -> None:
async with session.get('https://www.instagram.com/%s' % username) as response:
try:
r = await response.text()
if response.status == 404:
print('%s[AVAILABLE] https://www.instagram.com/%s%s' % ('u001b[32;1m', username, 'u001b[0m'))
write_file(username)
elif response.status == 200 and 'Login • Instagram' in r:
print('[!] Failed to check username. Try again later', username)
# if self.count == 50:
# print(r)
else:
print('%s[UNAVAILABLE] https://www.instagram.com/%s%s' % ('u001b[31;1m', username, 'u001b[0m'))
#self.count += 1
#print(r)
#print(response.status)
except Exception as e:
print('[ERROR] ' + e)
async def start(self):
tasks = []
async with aiohttp.ClientSession(headers=self.HEADERS) as session:
for i in self.to_check:
print('[*] Appending.. :', i)
tasks.append(asyncio.create_task(self._check(session, i)))
system('cls')
print('Loading.. This may take awhile.')
task = await asyncio.gather(*tasks)
return task
if __name__ == '__main__':
system('title Instagram Username Checker by $_$')
system('cls')
username_list = open_file()
checker = Checker(username_list)
loop = asyncio.get_event_loop()
loop.run_until_complete(checker.start())
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team