-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstapy.py
More file actions
305 lines (284 loc) · 11.1 KB
/
instapy.py
File metadata and controls
305 lines (284 loc) · 11.1 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# Import modules
import urllib.request
import json
import sys
import os
import time
try :
import requests
from igql import InstagramGraphQL
except ModuleNotFoundError:
os.system('pip install requests')
os.system('pip install igql')
sys.exit()
# For Console Color
W = "\033[0m"
G = '\033[32;1m'
Y = '\033[33;1m'
R = '\033[31;1m'
B = '\033[1;34;40m'
LB = '\033[1;36;40m'
BG_R = '\033[0;37;41m'
BG_G = '\033[0;37;42m'
BG_P = '\033[0;37;44m'
BG_K = '\033[0;37;45m'
dict = {
"logo":'''
██╗███╗ ██╗███████╗████████╗ █████╗ ██████╗ ██╗ ██╗
██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██╔══██╗╚██╗ ██╔╝
██║██╔██╗ ██║███████╗ ██║ ███████║██████╔╝ ╚████╔╝
██║██║╚██╗██║╚════██║ ██║ ██╔══██║██╔═══╝ ╚██╔╝
██║██║ ╚████║███████║ ██║ ██║ ██║██║ ██║
╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝
''',
"FirstMsg": '''
\tWELCOME TO InstaPy TOOLS
\tλ InstaPy V.1.0
\tλ BY Mohammad Taghizadeh (Tqzdh)
\tλ Get Instagram Users Information
\tGithub: https://github.com/M-Taghizadeh/InstaPy''',
"Spaces": "\n",
"No Internet": " You Are Not Connected ",
"Check": "You Must Be Connected With Internet ",
"Connected": "You Are Connected\n",
"Try": "Try Again\n",
"GoodBye": "[~] See You Later ",
"IK": '"',
"Help": '''
······················································
| Command | For What |
······················································
| Help | Show Help Table |
······················································
| CTRL + C + ENTER | EXIT FROM THE TOOL |
······················································
| Exit | EXIT FROM THE TOOL |
······················································
| Enter A Username | Dump All User Information |
······················································
''',
"Draw": '''
+ λ [ InstaPy V.1.0 ]
+ λ [ BY Mohammad Taghizadeh (Tqzdh) ]
+ λ [ Get Instagram Users Information ]
Github: https://github.com/M-Taghizadeh/InstaPy
>>> EXIT USE : CTRL + C + ENTER\n
''',
"Target": {
"USERNAME" : "",
},
"Headers": {
"content-type": "application/json",
"User-agent": "",
}
}
# MAIN
def main():
for char in dict["Connected"] :
sys.stdout.write(BG_G+char+W)
sys.stdout.flush()
time.sleep(0.05)
time.sleep(0.3)
os.system('cls')
Banner()
# FALSE MAIN
def FalseMain():
for char in dict["No Internet"] :
sys.stdout.write(BG_R+char+W)
sys.stdout.flush()
time.sleep(0.05)
time.sleep(1)
for char in dict["Check"] :
sys.stdout.write(Y+char+W)
sys.stdout.flush()
time.sleep(0.1)
for char in dict["Try"] :
sys.stdout.write(BG_R+char+W)
sys.stdout.flush()
time.sleep(0.1)
sys.exit()
# FLUSH
def Flush(Which):
for char in Which :
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(0.005)
time.sleep(0.05)
class DumpFromJsonFile :
USERNAME = ""
def GetUser(self):
try :
URL = 'https://www.instagram.com/'+self.USERNAME+'/?__a=1'
req = requests.get(url=URL, headers=dict["Headers"])
data = req.json()
except :
Flush(BG_P+" "+self.USERNAME+" "+BG_R+"NOT ON INSTAGRAM"+W+' > Error : GetUser() URL')
sys.exit()
try :
STORY_URL = 'https://www.instagram.com/graphql/query/?query_hash=c9100bf9110dd6361671f113dd02e7d6&variables={'+dict["IK"]+'user_id'+dict["IK"]+':'+dict["IK"]+data["graphql"]["user"]["id"]+dict["IK"]+','+dict["IK"]+'include_reel'+dict["IK"]+':true,'+dict["IK"]+'include_logged_out_extras'+dict["IK"]+':true}'
req_story = requests.get(url=STORY_URL, headers=dict["Headers"])
story = req_story.json() ["data"]["user"]["has_public_story"]
except :
pass
Flush(BG_R+"EXTRACTING DATA FROM : "+BG_P+" ", end='')
Flush((data["graphql"]["user"]["username"]).upper())
Flush(' '+W)
# SUREFACE DATA
Flush(BG_G+"SURFACE DATA "+W)
Flush(Y+"λ "+LB+"FULL NAME : "+W, end='')
Flush(data["graphql"]["user"]["full_name"])
Flush(Y+"λ "+LB+"PRIVATE ACCOUNT : "+W, end='')
Flush(str(data["graphql"]["user"]["is_private"]))
Flush(Y+"λ "+LB+"VERIFIED ACCOUNT : "+W, end='')
Flush(str(data["graphql"]["user"]["is_verified"]))
Flush(Y+"λ "+LB+"BUSINESS ACCOUNT : "+W, end='')
Flush(str(data["graphql"]["user"]["is_business_account"]))
try :
Flush(Y+"λ "+LB+"BUSINESS CATEGORY NAME : "+W, end='')
Flush(str(data["graphql"]["user"]["business_category_name"]))
except :
pass
Flush(Y+"λ "+LB+"SHOW SUGGESTED PROFILES : "+W, end='')
Flush(str(data["show_suggested_profiles"]))
Flush(Y+"λ "+LB+"SHOW FOLLOW DIALOG : "+W, end='')
Flush(str(data["show_follow_dialog"]))
Flush(Y+"λ "+LB+"SHOW VIEW SHOP : "+W, end='')
Flush(str(data["show_view_shop"]))
Flush(Y+"λ "+LB+"SHOW ACCOUNT CATEGORY : "+W, end='')
Flush(str(data["graphql"]["user"]["should_show_category"]))
try :
Flush(Y+"λ "+LB+"ACCOUNT CATEGORY NAME : "+W, end='')
Flush(data["graphql"]["user"]["category_name"])
Flush(Y+"λ "+LB+"ACCOUNT CATEGORY ENUM : "+W, end='')
Flush(data["graphql"]["user"]["category_enum"])
except :
pass
Flush(Y+"λ "+LB+"BIO : "+W, end='')
Flush(data["graphql"]["user"]["biography"])
try :
Flush(Y+"λ "+LB+"LINK IN BIO : "+W, end='')
Flush(data["graphql"]["user"]["external_url"])
Flush(Y+"λ "+LB+"INSIDE THIS LINK : "+W, end='')
Flush(data["graphql"]["user"]["external_url_linkshimmed"])
except :
pass
Flush(Y+"λ "+LB+"POSTS COUNT : "+W, end='')
Flush(str(data["graphql"]["user"]["edge_owner_to_timeline_media"]["count"]))
Flush(Y+"λ "+LB+"FELIX VIDEOS COUNT : "+W, end='')
Flush(str(data["graphql"]["user"]["edge_felix_video_timeline"]["count"]))
Flush(Y+"λ "+LB+"FOLLOWERS COUNT : "+W, end='')
Flush(str(data["graphql"]["user"]["edge_follow"]["count"]))
Flush(Y+"λ "+LB+"FOLLOWING COUNT : "+W, end='')
Flush(str(data["graphql"]["user"]["edge_followed_by"]["count"]))
Flush(Y+"λ "+LB+"HIGHLIGHT REEL COUNT : "+W, end='')
Flush(str(data["graphql"]["user"]["highlight_reel_count"]))
Flush(Y+"λ "+LB+"HAS PUBLIC STORY : "+W, end='')
Flush(str(story))
Flush(Y+"λ "+LB+"HAS AR EFFECTS : "+W, endFlush='')
Flush(str(data["graphql"]["user"]["has_ar_effects"]))
Flush(Y+"λ "+LB+"HAS CLIPS : "+W, end='')
Flush(str(data["graphql"]["user"]["has_clips"]))
Flush(Y+"λ "+LB+"HAS GUIDES : "+W, end='')
Flush(str(data["graphql"]["user"]["has_guides"]))
Flush(Y+"λ "+LB+"HAS CHANNEL : "+W, end='')
Flush(str(data["graphql"]["user"]["has_channel"]))
Flush ('')
# DEEP DATA
Flush (BG_K+"λ DEEP DATA "+W)
Flush (Y+"λ "+LB+"LOGGING PAGE ID : "+W, end='')
Flush(str(data["logging_page_id"]))
Flush (Y+"λ "+LB+"ID : "+W, end='')
Flush(data["graphql"]["user"]["id"])
# DARK DATA
Flush (BG_R+"DARK DATA "+W)
Flush (Y+"λ "+LB+"IS JOINED RECENTLY : "+W, end='')
Flush(str(data["graphql"]["user"]["is_joined_recently"]))
Flush(Y+"λ "+LB+"ACCOUNT AGE : "+W)
Flush(Y+" "+BG_P+"LOOKING FOR ACCOUNT AGE "+W)
Flush(W+'')
try :
Flush(Y+"λ "+LB+" CONNECTED WITH FACEBOOK : "+W,end='')
Flush(str(data["graphql"]["user"]["connected_fb_page"]))
Flush('')
except :
Flush(Y+"λ "+LB+" CONNECTED WITH FACEBOOK : "+W+" NO")
Flush(Y+"λ "+LB+"FBID : "+W, end='')
Flush(str(data["graphql"]["user"]["fbid"]))
Flush(Y+"λ "+LB+"COUNTRY BLOCK : "+W, end='')
Flush(str(data["graphql"]["user"]["country_block"]))
Flush(Y+"λ "+LB+"EMAIL : "+W, end='')
Flush("It can't be known right now.")
Flush(Y+"λ "+LB+"PHONE : "+W, end='')
Flush("It can't be known right now.")
# ASK
def Ask():
try :
command = input (LB+"λ InstaPy "+R+"/ "+LB+"USERNAME "+R+"> "+W)
if command.lower() == "help" :
Flush(dict["Help"])
Ask()
elif command.lower() == "exit" :
Flush(BG_P+dict["GoodBye"]+W)
sys.exit()
else :
try :
dict["Target"]["USERNAME"] = command
GetAll = DumpFromJsonFile()
GetAll.USERNAME = dict["Target"]["USERNAME"]
GetAll.GetUser()
except :
Flush(BG_P+" "+command+" "+BG_R+"NOT ON INSTAGRAM"+W+' > Error : GetAll.GetUser() Class')
Flush(Y+"[!]"+G+" CHANGE YOUR IP ADDRESS THEN TRY AGAIN"+W)
sys.exit()
except KeyboardInterrupt :
Flush(BG_P+dict["GoodBye"]+W)
sys.exit()
# BANNER
def Banner():
for space in dict["Spaces"]*5 :
sys.stdout.write(space)
sys.stdout.flush()
for char in dict["logo"] :
sys.stdout.write(R+char+W)
sys.stdout.flush()
time.sleep(0.1)
for char in dict["Draw"] :
sys.stdout.write(Y+char+W)
sys.stdout.flush()
time.sleep(0.005)
Ask()
# CHECK INTERNET
def connect():
try:
urllib.request.urlopen('http://google.com')
return True
except:
return False
# SCREEN
def Screen():
os.system('cls')
for space in dict["Spaces"]*5 :
sys.stdout.write(space)
sys.stdout.flush()
time.sleep(0.01)
for char in dict["logo"] :
sys.stdout.write(R+char+W)
sys.stdout.flush()
time.sleep(0.005)
time.sleep(0.1)
for char in dict["FirstMsg"] :
sys.stdout.write(B+char+W)
sys.stdout.flush()
time.sleep(0.05)
time.sleep(0.1)
for space in dict["Spaces"]*4 :
sys.stdout.write(space)
sys.stdout.flush()
time.sleep(0.01)
connect()
if connect() :
main()
else :
FalseMain()
# RUN
Screen()