-
Notifications
You must be signed in to change notification settings - Fork 13
/
instagram.py
71 lines (61 loc) · 1.69 KB
/
instagram.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from multiprocessing import Pool, Process, freeze_support, set_start_method, get_context
from multiprocessing import set_start_method
from requests.packages.urllib3.util.retry import Retry
import requests
import time
from proxy import getWorkingProxy
requests.packages.urllib3.disable_warnings()
"""
This code is licensed under QPL-1.0.
You CAN:
- Distribute
- Modify
You CANNOT:
- Commercial Use
You MUST:
- Include copyright
- Include license
- Disclose source
Source code can be found here:
https://git.landon.pw/r/social-checker
"""
def main():
set_start_method("spawn")
print("Checking Instagram names... No proxies needed.")
filename = input("What is the filename?: ")
usernames = open(f"wordlist/{filename}")
pool = Pool(processes=100)
lines = usernames.readlines()
start = time.time()
pool.map(request, lines)
ttl = time.time() - start
rps = len(lines) / ttl
print(f"Checking is completed.")
print(f"Took {ttl} seconds to check.")
print(f"{rps} names checked/second.")
def request(line):
#proxy = getWorkingProxy()
#proxies = {
# "http": "http://" + proxy
#}
url = "https://www.instagram.com/"
user = line.strip()
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"
}
try:
r = requests.get(url + user + "/", headers=headers, verify=False)
status = r.status_code
if (status == 404):
print(f"{user} is available.")
file = open("available.txt", "a")
file.write(url + user + "\n")
file.close()
else:
print(f"{user} is taken.")
except Exception as e:
print(f"Connection Error: {user}. Retrying.")
request(user)
if __name__ == '__main__':
freeze_support()
main()