This repository was archived by the owner on Jun 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstagramUserChecker.py
140 lines (128 loc) · 5.19 KB
/
InstagramUserChecker.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python: 2
# Version: 1.0
# Cyber_Soldiers_Security_Team: CSST
# link: https://t.me/CyberSoldiersST
# Github: github.com/SarbazVatan
# Coded By @Soldier_of iran
import threading, Queue, requests, sys, re
from bs4 import BeautifulSoup
reload(sys)
sys.setdefaultencoding("utf-8")
print '''
:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,
@@@@# << Instagram-User-Checker >> .@@@@
@@@# #@@@@.`@@@'
:@@@ * CSST * :@@@@@@ @@@@
@@@@ :@@@@@@ .@@@
@@@@ .::` :@@@@@@ @@@
@@@@ ,@@@@@@@@@' :@@@@@@ @@@
@@@@ `@@@@@@@@@@@@@+ :@@@@@@ @@@
@@@@ #@@@@@@@@@@@@@@@@ @@@@@: @@@
@@@@ @@@@@@. #@@@@@ @@@
@@@@ #@@@@` @@@@@ @@@
@@@@ `@@@@ #@@@@ @@@
@@@@@@@@@@@@@@ :++` @@@@@@@@@@@@@@
@@@@@@@@@@@@@` ,@@@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]: Sarbaz_Vatan
'''
def check(q):
while 1:
user = q.get()
if user != None:
try:
url = "http://instagram.com/"+user
source = requests.get(url, headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:51.0) Gecko/20100101 Firefox/51.0'})
if source.status_code == 200:
bs = BeautifulSoup(source.text, 'lxml')
allmeta = bs.find_all("meta")
spliter = str(allmeta[12]['content']).split(' ')
checked.append('{USER} | {FOLLOWERS} | {FOLLOWINGS} | {POSTS}'.format(USER=user, FOLLOWERS=spliter[0], FOLLOWINGS=spliter[2], POSTS=spliter[4]))
print '\n\n[Username]: {0}\n[Followers]: {1}\n[Followings]: {2}\n[Posts]: {3}'.format(user, spliter[0], spliter[2], spliter[4])
q.task_done()
else:
print "\n[-]Check your connection and try again..."
except:
print '\n\n[Timeout]'
q.task_done()
else:
q.task_done()
def sort(i):
for x in checked:
if i == 1:
users_by_sort[x] = int(str(x.split(' | ')[1]).replace(',', '').replace('.', '').replace('k', '0'*3).replace('m', '0'*6))
elif i == 2:
users_by_sort[x] = int(str(x.split(' | ')[2]).replace(',', '').replace('.', '').replace('k', '0'*3).replace('m', '0'*6))
elif i == 3:
users_by_sort[x] = int(str(x.split(' | ')[3]).replace(',', '').replace('.', '').replace('k', '0'*3).replace('m', '0'*6))
LIST_1 = users_by_sort.values()
for n in range(len(LIST_1)):
max_number = max(LIST_1)
for k in users_by_sort.keys():
if users_by_sort[k] == max_number:
final.append(k)
LIST_1.remove(max_number)
save_checks(final)
def save_checks(LIST):
with open('results.txt', 'a') as rs:
for x in LIST:
rs.write('\n'+str(x))
rs.close()
def start_thread():
global input_queue
global checked
global final
global users_by_sort
for x in range(thread):
aa = threading.Thread(target=check, args=(input_queue,))
aa.setDaemon(True)
aa.start()
for xx in open(user_list, 'r').readlines():
input_queue.put(str(xx).strip())
input_queue.put(None)
input_queue.join()
if __name__ == "__main__":
input_queue = Queue.Queue()
checked = []
users_by_sort = {}
final = []
user_list = raw_input("\a\n[#]UsersList: ")
thread = int(raw_input("[+]Thread: "))
print '''\n[*]Sort by:\n\t[1]Followers\n\t[2]Followings\n\t[3]Posts'''
num = input(">>> ")
save_results = open('results.txt', 'a')
save_results.write('\n\n\n<<< Username | Followers | Followings | Posts >>>\n\n')
save_results.close()
start_thread()
sort(num)
raw_input("\n\n\a[~]Job Finished :D")