-
Notifications
You must be signed in to change notification settings - Fork 10
/
IAM.py
3262 lines (3160 loc) · 129 KB
/
IAM.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
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
"""
Author: new92
Github: @new92
Leetcode: @new92
PyPI: @new92
[-->] Script for Managing your Instagram Account Remotely
IAM: Instagram Account Manager
******************************|IMPORTANT|*******************************
* User's data (such as username password) will not be stored or saved !*
* Will be used only for some functions of the script. *
************************************************************************
"""
try:
import sys
from time import sleep
if sys.version_info[0] < 3:
print("[!] Error ! IAM requires Python version 3.X ! ")
sleep(2)
print("""[+] Instructions to download Python 3.x :
Linux: apt install python3
Windows: https://www.python.org/downloads/
MacOS: https://docs.python-guide.org/starting/install3/osx/""")
sleep(3)
print("[+] Please install Python 3 and then use IAM ✅")
sleep(2)
print("[+] Exiting...")
sleep(1)
quit()
import platform
from os import system
from rich.align import Align
from rich.table import Table
from rich.console import Console
from rich.live import Live
console = Console()
mods = ['sys', 'time', 'os', 'platform', 'rich', 'instagrapi', 'requests', 'json', 'instaloader', 'tkinter', 'colorama']
with console.status('[bold dark_orange]Loading module...') as status:
for mod in mods:
sleep(0.8)
console.log(f'[[bold red]{mod}[/]] => [bold dark_green]okay')
import instagrapi
import instaloader
import json
import requests as re
import os
from colorama import init, Fore
from tkinter import *
except (ImportError, ModuleNotFoundError):
print("[!] WARNING: Not all packages used in IAM have been installed !")
sleep(2)
print("[+] Ignoring warning...")
sleep(1)
if sys.platform.startswith('linux'):
if os.geteuid() != 0:
print("[!] Root user not detected !")
sleep(2)
print("[+] Trying to enable root user...")
sleep(1)
system("sudo su")
try:
system("sudo pip install -r requirements.txt")
except Exception as ex:
print("[!] Error ! Cannot install the required modules !")
sleep(1)
print("[*] Error message ==> {ex}")
sleep(2)
print("[1] Uninstall script")
print("[2] Exit")
opt=int(input(f"[>] Please enter a number (from the above ones): "))
while opt < 1 or opt > 2:
print("[!] Invalid number !")
sleep(1)
print("[*] Acceptable numbers: [1/2]")
sleep(1)
print("[1] Uninstall script")
print("[2] Exit")
opt=int(input(f"[>] Please enter again a number (from the above ones): "))
if opt == 1:
def fpath(fname: str):
for root, dirs, files in os.walk('/'):
if fname in files:
return os.path.abspath(os.path.join(root, fname))
def rmdir(dire):
DIRS = []
for root, dirs, files in os.walk(dire):
for file in files:
os.remove(os.path.join(root,file))
for dir in dirs:
DIRS.append(os.path.join(root,dir))
for i in range(len(DIRS)):
os.rmdir(DIRS[i])
os.rmdir(dire)
rmdir(fpath('IAM'))
print("[✓] Files and dependencies uninstalled successfully !")
else:
print("[+] Exiting...")
sleep(1)
print("[+] See you next time 👋")
exit(0)
else:
system("sudo pip install -r requirements.txt")
elif sys.platform == 'darwin':
system("python -m pip install requirements.txt")
elif platform.system() == 'Windows':
system("pip3 install -r requirements.txt")
loader=instaloader.Instaloader()
client=instagrapi.Client()
init(autoreset=True)
green = Fore.GREEN
red = Fore.RED
yellow = Fore.YELLOW
sleep(0.8)
console.clear()
console.print(f"[bold dark_green][✓] Successfully loaded modules.")
sleep(0.8)
console.clear()
def fpath(fname: str):
for root, dirs, files in os.walk('/'):
if fname in files:
return os.path.abspath(os.path.join(root, fname))
def banner() -> str:
return f"""{green}
██╗░█████╗░███╗░░░███╗
██║██╔══██╗████╗░████║
██║███████║██╔████╔██║
██║██╔══██║██║╚██╔╝██║
██║██║░░██║██║░╚═╝░██║
╚═╝╚═╝░░╚═╝╚═╝░░░░░╚═╝
"""
def clear():
system('cls' if platform.system() == 'Windows' else 'clear')
def Get_Hpk(url:str) -> str:
return client.highlight_pk_from_url(url)
def Get_Spk(url:str) -> str:
return client.story_pk_from_url(url)
def valUser(user):
return re.get(f"https://www.instagram.com/{user}/", allow_redirects=False).status_code != 200
def Except(ex:str):
print(f"{red}[!] Error !")
sleep(1)
print(f"{yellow}[*] Error message ==> {ex}")
sleep(2)
print(f"{yellow}[1] Return to menu")
print(f"{yellow}[2] Exit")
num=int(input(f"{yellow}[::] Number (from the above ones) >>> "))
while num < 1 or num > 2:
print(f"{red}[!] Invalid number !")
sleep(1)
print(f"{green}[*] Acceptable numbers: [1/2]")
sleep(1)
print(f"{yellow}[1] Return to menu")
print(f"{yellow}[2] Exit")
num=int(input(f"{yellow}[::] Number (from the above ones) >>> "))
if num == 1:
clear()
main()
else:
print(f"{yellow}[+] Exiting...")
sleep(1)
print(f"{yellow}[+] See you next time 👋")
sleep(1)
exit(0)
def checkOpt(opt,data):
if data == "username":
print(f"{red}[!] Invalid length !")
sleep(1)
print(f"{green}[*] Acceptable length: less than or equal to 30 characters")
elif data == "id":
print(f"{red}[!] Invalid length !")
sleep(1)
print(f"{green}[*] Acceptable length: greater than 3")
elif data == "path":
print(f"{green}[*] Path must contain: / or \\ ")
else:
print(f"{red}[!] Invalid number !")
def valOpt(opt:int,x:int,y:int):
return opt < x or opt > y
def CheckVal() -> str:
print(f"{red}[!] User not found !")
sleep(1)
print(f"{yellow}[1] Try with another username")
print(f"{yellow}[2] Return to menu")
print(f"{yellow}[3] Exit")
opt=int(input(f"{yellow}[::] Number (from the above ones) >>> "))
while valOpt(opt,1,3):
checkOpt(opt, 'other')
sleep(1)
print(f"{yellow}[1] Try with another username")
print(f"{yellow}[2] Return to menu")
print(f"{yellow}[3] Exit")
opt=int(input(f"{yellow}[::] Number (from the above ones) >>> "))
if opt == 1:
username=input(f"{yellow}[::] Username >>> ")
while checkUser(username):
checkOpt(opt, 'username')
sleep(1)
username=input(f"{yellow}[::] Username >>> ")
return username
elif opt == 2:
clear()
main()
else:
print(f"{yellow}[+] Thank you for using IAM 😁")
sleep(0.8)
print(f"{yellow}[+] See you next time 👋")
sleep(0.8)
exit(0)
return False
ANS = ['yes', 'no']
NULL = ['', ' ']
def Uninstall() -> str:
def rmdir(dire):
DIRS = []
for root, dirs, files in os.walk(dire):
for file in files:
os.remove(os.path.join(root,file))
for dir in dirs:
DIRS.append(os.path.join(root,dir))
for i in range(len(DIRS)):
os.rmdir(DIRS[i])
os.rmdir(dire)
rmdir(fpath('IAM'))
return f"{green}[✓] Files and dependencies uninstalled successfully !"
def Next() -> int:
sleep(1)
print(f"{yellow}[1] Return to menu")
print(f"{yellow}[2] Exit")
opt=int(input(f"{yellow}[::] Number (from the above ones) >>> "))
while valOpt(opt,1,2):
print(f"{red}[!] Invalid number !")
sleep(1)
print(f"{green}[*] Acceptable numbers: [1/2]")
sleep(1)
opt=int(input(f"{yellow}[::] Number (from the above ones) >>> "))
return opt
def Class():
main() if Next() == 1 else Exiting()
def Exiting():
print(f"{yellow}[+] Exiting...")
sleep(1)
print(f"{yellow}[+] See you next time 👋")
sleep(1)
exit(0)
def checkCount(num: int) -> bool:
return num < 1
def checkTag(tag: str) -> bool:
return "#" not in tag or tag in NULL
def checkPath(path: str) -> bool:
return path in NULL or "/" not in path or "\\" not in path
def AvActs() -> str:
return f"""{yellow}
1) Publish post(s)
2) Change profile pic
3) Upload story with pic
4) Publish IGTV video
5) Follow user(s)
6) Unfollow user(s)
"""
def ScriptInfo():
with open('./config.json') as config:
conf = json.load(config)
f = f"{conf['name']}.py"
fp = fpath(f) is None
fsize = os.stat(fpath(f).st_size if fp else 0)
print(f"{yellow}[+] Author ==> {conf['author']}")
print(f"{yellow}[+] Github ==> @{conf['author']}")
print(f"{yellow}[+] License ==> {conf['lice']}")
print(f"{yellow}[+] Script's name ==> {conf['name']}")
print(f"{yellow}[+] Script's version ==> {conf['version']}")
print(f"{yellow}[+] Programming language(s) used ==> {conf['lang']}")
print(f"{yellow}[+] Natural language ==> {conf['language']}")
print(f"{yellow}[+] File size ==> {fsize} bytes")
print(f"{yellow}[+] File path ==> {fpath(f)}")
print(f"{yellow}[+] Number of lines ==> {conf['lines']}")
print(f"{yellow}[+] API(s) used ==> {conf['api']}")
print(f"{yellow}|======|GITHUB REPO INFO|======|")
print(f"{yellow}[+] Stars ==> {conf['stars']}")
print(f"{yellow}[+] Forks ==> {conf['forks']}")
print(f"{yellow}[+] Open issues ==> {conf['issues']}")
print(f"{yellow}[+] Closed issues ==> {conf['clissues']}")
print(f"{yellow}[+] Open pull requests ==> {conf['prs']}")
print(f"{yellow}[+] Closed pull requests ==> {conf['clprs']}")
print(f"{yellow}[+] Discussions ==> {conf['discs']}")
def checkUser(username: str) -> bool:
return username in NULL or len(username) > 30
def GetID(username: str) -> int:
return loader.check_profile_id(username)
def checkID(id: int) -> bool:
return not id or len(id) < 3
TABLE = [
[
"[b white]Author[/]: [i light_green]new92[/]",
"[green]https://new92.github.io/[/]"
],
[
"[b white]Github[/]: [i light_green]@new92[/]",
"[green]https://github.com/new92[/]"
],
[
"[b white]Leetcode[/]: [i light_green]@new92[/]",
"[green]https://leetcode.com/new92[/]"
],
[
"[b white]PyPI[/]: [i light_green]@new92[/]",
"[green]https://pypi.org/user/new92[/]"
]
]
TaggedUsers, Location, Locations, REC, LOCATIONS, LINKS, IDS, HASHTAGS, FUFERS, FUFING, LTAGS, LBU, MSGIDS, FILEIDS, PHOTOIDS, VIDEOIDS, LBL, BLOCKU, REPLS, STIDS, STBTGS, GTST, HASHVID, LOCLIKE = [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []
random, sktp = None, None
count = 0
def main():
console = Console()
table = Table(show_footer=False)
centered = Align.center(table)
print(banner())
print("\n")
print(f"{yellow}[+] IAM: Instagram Account Manager")
print("\n")
print(f"{yellow}[+] Python script for managing your instagram account remotely.")
print("\n")
with Live(centered, console=console, screen=False):
table.add_column('Socials', no_wrap=False)
table.add_column('Url', no_wrap=False)
for row in TABLE:
table.add_row(*row)
print("\n")
print(f"{yellow}[1] Display profile ID")
print(f"{yellow}[2] Display security information")
print(f"{yellow}[3] Display account info")
print(f"{yellow}[4] Display pending follow requests")
print(f"{yellow}[5] Display followers")
print(f"{yellow}[6] Display the users you Follow")
print("\n")
print(f"{yellow}[7] Download my highlights")
print(f"{yellow}[8] Download anonymous stories of other users")
print(f"{yellow}[9] Download my saved posts")
print(f"{yellow}[10] Download posts from my feed")
print("\n")
print(f"{yellow}[11] Publish post(s)")
print(f"{yellow}[12] Enable/Disable notifications")
print(f"{yellow}[13] Change profile pic")
print(f"{yellow}[14] Upload story with pic")
print(f"{yellow}[15] Publish IGTV video")
print("\n")
print(f"{yellow}[16] Follow user(s)")
print(f"{yellow}[17] Unfollow user(s)")
print(f"{yellow}[18] Accept follow request(s)")
print(f"{yellow}[19] Reject follow request(s)")
print(f"{yellow}[20] Follow user's followers")
print(f"{yellow}[21] Follow user's following")
print("\n")
print(f"{yellow}[22] Send DM (Direct Message)")
print(f"{yellow}[23] Send file")
print(f"{yellow}[24] Send photo")
print(f"{yellow}[25] Send video")
print("\n")
print(f"{yellow}[26] Like the posts from hashtag(s)")
print(f"{yellow}[27] Like the posts from user(s)")
print(f"{yellow}[28] Like the posts from location(s)")
print(f"{yellow}[29] Like the posts from feed")
print("\n")
print(f"{yellow}[30] Comment by user")
print(f"{yellow}[31] Set default reply to comments")
print(f"{yellow}[32] Comment {red}<== CURRENTLY UNAVAILABLE")
print("\n")
print(f"{yellow}[33] Block User(s)")
print(f"{yellow}[34] Get username from user ID")
print(f"{yellow}[35] Get a list of all users you have blocked")
print("\n")
print(f"{yellow}[36] Create highlight(s)")
print(f"{yellow}[37] Delete highlight(s)")
print(f"{yellow}[38] Change the cover of highlight(s)")
print(f"{yellow}[39] Display the highlights of user(s)")
print(f"{yellow}[40] Retrieve information from highlight(s)")
print("\n")
print(f"{yellow}[41] Delete story")
print(f"{yellow}[42] Get story viewers")
print(f"{yellow}[43] Get stories by hashtags")
print(f"{yellow}[44] Get stories by users")
print(f"{yellow}[45] Retrieve information of a story")
print("\n")
print(f"{yellow}[46] Change country")
print(f"{yellow}[47] Change bio")
print(f"{yellow}[48] Gather information for a user")
print(f"{yellow}[49] Get information about posts where user is tagged")
print(f"{yellow}[50] Reset password")
print("\n")
print(f"{yellow}[51] Edit profile")
print("\n")
print(f"{yellow}[52] Set a specific time (from the current day) to execute an action")
print("\n")
print(f"{yellow}[53] Hide stories from a specific user")
print("\n")
print(f"{yellow}[54] Uninstall script")
print("\n")
print(f"{yellow}[999] Show script's info")
print("\n")
print(f"{yellow}[0] Exit")
print("\n")
option=int(input(f"{yellow}[::] Please enter a number (from the above ones) >>> "))
while valOpt(option,1,54) and opt != 999:
checkOpt(option, "other")
sleep(2)
print(f"{yellow}[1] Display profile ID")
print(f"{yellow}[2] Display security information")
print(f"{yellow}[3] Display account info")
print(f"{yellow}[4] Display pending follow requests")
print(f"{yellow}[5] Display followers")
print(f"{yellow}[6] Display the users you Follow")
print("\n")
print(f"{yellow}[7] Download my highlights")
print(f"{yellow}[8] Download anonymous stories of other users")
print(f"{yellow}[9] Download my saved posts")
print(f"{yellow}[10] Download posts from my feed")
print("\n")
print(f"{yellow}[11] Publish post(s)")
print(f"{yellow}[12] Enable/Disable notifications")
print(f"{yellow}[13] Change profile pic")
print(f"{yellow}[14] Upload story with pic")
print(f"{yellow}[15] Publish IGTV video")
print("\n")
print(f"{yellow}[16] Follow user(s)")
print(f"{yellow}[17] Unfollow user(s)")
print(f"{yellow}[18] Accept follow request(s)")
print(f"{yellow}[19] Reject follow request(s)")
print(f"{yellow}[20] Follow user's followers")
print(f"{yellow}[21] Follow user's following")
print("\n")
print(f"{yellow}[22] Send DM (Direct Message)")
print(f"{yellow}[23] Send file")
print(f"{yellow}[24] Send photo")
print(f"{yellow}[25] Send video")
print("\n")
print(f"{yellow}[26] Like the posts from hashtag(s)")
print(f"{yellow}[27] Like the posts from user(s)")
print(f"{yellow}[28] Like the posts from location(s)")
print(f"{yellow}[29] Like the posts from feed")
print("\n")
print(f"{yellow}[30] Comment by user")
print(f"{yellow}[31] Set default reply to comments")
print(f"{yellow}[32] Comment {red}<== CURRENTLY UNAVAILABLE")
print("\n")
print(f"{yellow}[33] Block User(s)")
print(f"{yellow}[34] Get username from user ID")
print(f"{yellow}[35] Get a list of all users you have blocked")
print("\n")
print(f"{yellow}[36] Create highlight(s)")
print(f"{yellow}[37] Delete highlight(s)")
print(f"{yellow}[38] Change the cover of highlight(s)")
print(f"{yellow}[39] Display the highlights of user(s)")
print(f"{yellow}[40] Retrieve information from highlight(s)")
print("\n")
print(f"{yellow}[41] Delete story")
print(f"{yellow}[42] Get story viewers")
print(f"{yellow}[43] Get stories by hashtags")
print(f"{yellow}[44] Get stories by users")
print(f"{yellow}[45] Retrieve information of a story")
print("\n")
print(f"{yellow}[46] Change country")
print(f"{yellow}[47] Change bio")
print(f"{yellow}[48] Gather information for a user")
print(f"{yellow}[49] Get information about posts where user is tagged")
print(f"{yellow}[50] Reset password")
print("\n")
print(f"{yellow}[51] Edit profile")
print("\n")
print(f"{yellow}[52] Set a specific time (from the current day) to execute an action")
print("\n")
print(f"{yellow}[53] Hide stories from a specific user")
print("\n")
print(f"{yellow}[54] Uninstall script")
print("\n")
print(f"{yellow}[999] Show script's info")
print("\n")
print(f"{yellow}[0] Exit")
print("\n")
option=int(input(f"{yellow}[::] Please enter again a number (from the above ones) >>> "))
if option != 0:
clear()
print("\n")
print(f"|--------------------|LOGIN|--------------------|")
print("\n")
username=input(f"{yellow}[::] Please enter your username >>> ").lower().strip()
while checkUser(username):
checkOpt(username, "username")
sleep(1)
username=input(f"{yellow}[::] Please enter again your username >>> ").lower().strip()
while valUser(username):
resp = CheckVal()
if type(resp) == bool:
CheckVal()
else:
username = resp
global globalu
globalu = username
password=input(f"{yellow}[::] Please enter your password >>> ").strip()
while password in NULL:
print(f"{red}[✕] This field can't be blank !")
sleep(1)
password=input(f"{yellow}[::] Please enter again your password >>> ").strip()
path=input(f"{yellow}[::] Please enter the path to the session file >>> ").strip()
try:
loader.load_session_from_file(username, path)
client.login(username,password,True)
except Exception as ex:
Except(ex)
if option == 999:
clear()
ScriptInfo()
elif option == 0:
clear()
print(f"{yellow}[+] Thank you for using IAM 😁")
sleep(2)
print(f"{yellow}[+] See you next time 👋")
sleep(1)
exit(0)
elif option == 1:
clear()
try:
print(f"{yellow}[+] Your ID >>> {GetID(username)}")
except Exception as ex:
Except(ex)
elif option == 2:
clear()
try:
sec=client.account_security_info()
print(f"{yellow}[+] Phone number confirmed >>> {sec['is_phone_confirmed']}")
print(f"{yellow}[+] 2FA (2 factor authentication) enabled >>> {sec['is_two_factor_enabled']}")
print(f"{yellow}[+] Time-based One-Time Passwords (TOTP) authentication enabled >>> {sec['is_totp_two_factor_enabled']}")
print(f"{yellow}[+] Trusted notifications enabled >>> {sec['is_trusted_notifications_enabled']}")
print(f"{yellow}[+] Eligible for Whatsapp 2 factor authentication >>> {sec['is_eligible_for_whatsapp_two_factor']}")
print(f"{yellow}[+] Whatsapp 2FA >>> {sec['is_whatsapp_two_factor_enabled']}")
print(f"{yellow}[+] Backup codes >>> {sec['backup_codes']}")
print(f"{yellow}[+] Trusted devices >>> {sec['trusted_devices']}")
print(f"{yellow}[+] Reachable email >>> {sec['has_reachable_email']}")
print(f"{yellow}[+] Eligible for trusted notifications >>> {sec['eligible_for_trusted_notifications']}")
print(f"{yellow}[+] Eligible for multiple TOTP >>> {sec['is_eligible_for_multiple_totp']}")
print(f"{yellow}[+] TOTP seeds >>> {sec['totp_seeds']}")
print(f"{yellow}[+] Can add additional TOTP seed >>> {sec['can_add_additional_totp_seed']}")
except Exception as ex:
Except(ex)
elif option == 3:
clear()
try:
print(f"{yellow}[+] Your account info >>> {client.account_info()}")
Class()
except Exception as ex:
Except(ex)
elif option == 4:
clear()
try:
print(api.friendships_pending())
Class()
except Exception as ex:
Except(ex)
elif option == 5:
clear()
print(GetID(username))
id=int(input(f"{yellow}[::] ID >>> "))
while checkID(id):
checkOpt(id, "id")
sleep(1)
id=int(input(f"{yellow}[::] ID (as shown above) >>> "))
try:
print(client.user_followers(id))
Class()
except Exception as ex:
Except(ex)
elif option == 6:
clear()
print(GetID(username))
id=int(input(f"{yellow}[::] ID >>> "))
while checkID(id):
checkOpt(id,"id")
sleep(1)
id=int(input(f"{yellow}[::] ID (as shown above) >>> "))
try:
print(client.user_following(id))
Class()
except Exception as ex:
Except(ex)
elif option == 7:
clear()
print(GetID(username))
id=int(input(f"{yellow}[::] ID >>> "))
while checkID(id):
checkOpt(id,"id")
sleep(1)
id=int(input(f"{yellow}[::] ID (as shown above) >>> "))
try:
print(f"{yellow}[+] Fetching highlights...")
sleep(1)
highlights=loader.download_highlights(id)
sleep(1)
print(f"{green}[✓] Fetch complete.")
sleep(0.7)
print(f"{yellow}[+] Highlights saved at >>> {fpath(highlights)}")
Class()
except Exception as ex:
Except(ex)
elif option == 8:
clear()
count=int(input(f"{yellow}[+] Number of accounts >>> "))
while valOpt(count,1,999):
checkOpt(count,'other')
sleep(1)
count=int(input(f"{yellow}[::] Number of accounts >>> "))
for i in range(count):
username=input(f"{yellow}[::] Username >>> ")
while checkUser(username):
checkOpt(username, "username")
sleep(1)
username=input(f"{yellow}[::] Username >>> ")
while valUser(username):
if type(CheckVal()) == bool:
CheckVal()
else:
username = CheckVal()
username = username.lower().strip()
print(GetID(username))
id=int(input(f"{yellow}[::] ID >>> "))
while checkID(id):
checkOpt(id,"id")
sleep(1)
id=int(input(f"{yellow}[::] ID (as shown above) >>> "))
IDS.append(id)
try:
print(f"{yellow}[+] Fetching stories...")
sleep(1)
loader.download_stories(IDS)
sleep(1)
print(f"{green}[✓] Fetch complete.")
sleep(0.7)
print(f"{yellow}[+] Stories saved at >>> {fpath(':stories')}")
Class()
except Exception as ex:
Except(ex)
elif option == 9:
clear()
count=int(input(f"{yellow}[?] Number of saved posts to download >>> "))
while checkCount(count):
checkOpt(count, "other")
sleep(1)
count=int(input(f"{yellow}[?] Number of saved posts to download >>> "))
try:
print(f"{yellow}[+] Fetching posts...")
sleep(1)
loader.download_saved_posts(count)
sleep(1)
print(f"{green}[✓] Fetch complete.")
sleep(0.7)
print(f"{yellow}[+] Saved posts at >>> {fpath(':saved')}")
Class()
except Exception as ex:
Except(ex)
elif option == 10:
clear()
count=int(input(f"{yellow}[?] Number of posts to download >>> "))
while checkCount(count):
checkOpt(count, "other")
sleep(1)
count=int(input(f"{yellow}[?] Number of posts to download >>> "))
try:
print(f"{yellow}[+] Fetching posts...")
sleep(1)
loader.download_feed_posts(count)
sleep(1)
print(f"{green}[✓] Fetch complete.")
sleep(0.7)
print(f"{yellow}[+] Feed posts at >>> {fpath(':feed')}")
Class()
except Exception as ex:
Except(ex)
elif option == 11:
clear()
count=int(input(f"{yellow}[::] Number of posts to post >>> "))
while checkCount(count):
checkOpt(count, "other")
sleep(1)
count=int(input(f"{yellow}[::] Number of posts to post >>> "))
default = 'Check out my new post !'
for i in range(count):
path=input(f"{yellow}[::] Path to photo >>> ")
while checkPath(path):
checkOpt(path, "path")
sleep(1)
path=input(f"{yellow}[::] Path to photo (to be uploaded) >>> ")
sleep(2)
print(f"{yellow}>>>CAPTION<<<")
sleep(1)
print(f"{yellow}[+] Default: {default}")
sleep(2)
print(f"{yellow}[*] Hit <Enter> to apply the default caption")
sleep(2)
caption=input(f"{yellow}[::] Caption >>> ")
if caption == '':
caption = default
print(f"{yellow}>>>TAGS<<<")
sleep(2)
print(f"{yellow}[+] Default: {ANS[1]}")
sleep(2)
print(f"{yellow}[*] Hit <Enter> to apply the default option")
sleep(2)
print(f"{green}[*] Acceptable answers: {ANS}")
sleep(2)
tags=input(f"{yellow}[?] Tag users >>> ").lower()
while tags not in ANS or tags in NULL:
if tags in NULL:
print(f"{red}[!] This field can't be empty !")
else:
print(f"{red}[!] Invalid answer !")
sleep(1)
print(f"{green}[*] Acceptable answers >>> {ANS}")
sleep(1)
tags=input(f"{yellow}[?] Tag users >>> ").lower()
if tags == ANS[0]:
print(f"{yellow}[+] Default: 1")
sleep(2)
print(f"{yellow}[*] Hit <Enter> to apply the default option")
sleep(1)
count=input(f"{yellow}[?] Number of users to tag >>> ")
if count == '':
username=input(f"{yellow}[::] Username >>> ")
while checkUser(username):
checkOpt(username, "username")
sleep(1)
username=input(f"{yellow}[::] Username >>> ")
while valUser(username):
CheckVal()
username = username.lower().strip()
else:
while checkCount(count):
checkOpt(count,"other")
sleep(1)
count=int(input(f"{yellow}[?] Number of users to tag >>> "))
for i in range(count):
utag=input(f"{yellow}[::] Username No{i+1} >>> ")
while checkUser(utag):
checkOpt(utag,"username")
sleep(1)
utag=input(f"{yellow}[::] Username No{i+1} >>> ")
while valUser(utag):
CheckVal()
utag = utag.strip().lower()
TaggedUsers.append(utag)
print(f"{yellow}>>>LOCATION<<<")
sleep(2)
print(f"{yellow}[+] Default >>> {ANS[1]}")
sleep(1)
print(f"{yellow}[*] Hit <Enter> to apply the default option")
sleep(2)
print(f"{green}[*] Acceptable answers >>> {ANS}")
sleep(1)
loc=input(f"{yellow}[?] Include location(s) >>> ").lower()
if loc == ANS[0]:
count=int(input(f"{yellow}[?] Number >>> "))
while checkCount(count):
checkOpt(count,"other")
sleep(1)
count=int(input(f"{yellow}[?] Number >>> "))
for i in range(count):
location=input(f"{yellow}[::]Location No{i+1}: ")
while location in NULL:
print(f"{red}[✕] This field can't be blank !")
sleep(1)
location=input(f"{yellow}[::] Location No{i+1}: ")
LOCATIONS.append(location)
print(f"{green}[✓] Location added !")
try:
client.photo_upload(path=path,caption=caption,usertags=TaggedUsers,location=LOCATIONS)
sleep(1)
print(f"{green}[✓] Photo uploaded !")
Class()
except Exception as ex:
Except(ex)
if tags in ANS and loc in ANS:
try:
client.photo_upload(path=path,caption=caption,usertags=TaggedUsers,location=LOCATIONS)
sleep(2)
print(f"{green}[✓] Photo uploaded !")
Class()
except Exception as ex:
Except(ex)
elif tags in ANS and loc in ANS:
try:
client.photo_upload(path=path,caption=caption,tags=TaggedUsers)
sleep(2)
print(f"{green}[✓] Photo uploaded !")
Class()
except Exception as ex:
Except(ex)
elif tags in ANS and loc in ANS:
try:
client.photo_upload(path=path,caption=caption,location=LOCATIONS)
sleep(2)
print(f"{green}[✓] Photo uploaded !")
Class()
except Exception as ex:
Except(ex)
elif tags in ANS and loc in ANS:
try:
client.photo_upload(path=path,caption=caption)
sleep(2)
print(f"{green}[✓] Photo uploaded !")
Class()
except Exception as ex:
Except(ex)
elif option == 12:
clear()
EN = ["enable","disable"]
print(f"{green}[*] Acceptable answers >>> {EN}")
sleep(1)
endis=input(f"{yellow}[?] ENTER >>> ").lower()
while endis not in EN or endis in NULL:
print(f"{red}[✕] This field can't be blank !") if endis in NULL else print(f"{red}[!] Invalid input !")
sleep(1)
print(f"{green}[*] Acceptable answers >>> {EN}")
sleep(1)
endis=input(f"{yellow}[?] Notifications to enable >>> ").lower()
if endis == EN[0]:
noti = ['posts', 'reels', 'stories', 'videos']
print(f"{green}[*] Notifications available for: {noti}")
sleep(2)
action=input(f"{yellow}[?] Notifications to enable >>> ").lower()
while action not in noti or action in NULL:
print(f"{red}[✕] This field can't be blank !") if action in NULL else print(f"{red}[!] Invalid input !")
sleep(1)
print(f"{green}[*] Acceptable answers: {noti}")
sleep(1)
action=input(f"{yellow}[?] Please enter again the notifications to enable >>> ").lower()
if action == "posts":
print(GetID(globalu))
uid=int(input(f"{yellow}[::] ID (as shown above) >>> "))
while checkID(uid):
checkOpt(uid, "id")
sleep(1)
uid=int(input(f"{yellow}[::] ID (as shown above) >>> "))
try:
print(f"{green}[✓] Post notifications enabled !") if client.enable_posts_notifications(uid) else print(f"{red}[✕] Unable to enable post notifications !")
Class()
except Exception as ex:
Except(ex)
elif action.lower() == "reels":
print(GetID(globalu))
uid=int(input(f"{yellow}[::] ID (as shown above) >>> "))
while checkID(uid):
checkOpt(uid, "id")
sleep(1)
uid=int(input(f"{yellow}[::] ID (as shown above) >>> "))
try:
print(f"{green}[✓] Reels notifications enabled !") if client.enable_reels_notifications(uid) else print(f"{red}[✕] Unable to enable reels notifications !")
Class()
except Exception as ex:
Except(ex)
elif action.lower() == "stories":
print(GetID(globalu))
uid=int(input(f"{yellow}[::] ID (as shown above) >>> "))
while checkID(uid):
checkOpt(uid, 'id')
sleep(1)
uid=int(input(f"{yellow}[::] ID (as shown above) >>> "))
try:
print(f"{green}[✓] Stories notifications enabled !") if client.enable_stories_notifications(uid) else print(f"{yellow}[✕] Unable to enable stories notifications !")
Class()
except Exception as ex:
Except(ex)
else:
print(GetID(globalu))
uid=int(input(f"{yellow}[::] ID (as shown above) >>> "))
while checkID(uid):
checkOpt(uid, "id")
sleep(1)
uid=int(input(f"{yellow}[::] ID (as shown above) >>> "))
try:
print(f"{green}[✓] Stories video enabled !") if client.enable_video_notifications(uid) else print(f"{yellow}[✕] Unable to enable video notifications !")
Class()
except Exception as ex:
Except(ex)
elif option == 13:
clear()
path=input(f"{yellow}[::] Path to pic >>> ")
while checkPath(path):
checkOpt(path, "path")
sleep(1)
path=input(f"{yellow}[::] Path to pic >>> ")
try:
client.account_change_picture(path)
print(f"{green}[✓] Your profile pic changed !")
Class()
except Exception as ex:
Except(ex)
elif option == 14:
clear()
path=input(f"{yellow}[::] Path to photo >>> ")
while checkPath(path):
checkOpt(path, "path")
sleep(1)
path=input(f"{yellow}[::] Path to photo >>> ")
sleep(2)
print(f"{green}[*] Acceptable answers: {ANS}")
sleep(1)
AddCaption=input(f"{yellow}[?] Add caption >>> ").lower()
while AddCaption not in ANS or AddCaption in NULL:
if AddCaption in NULL:
print(f"{red}[✕] This field can't be blank !")
else:
print(f"{red}[!] Invalid input !")
sleep(1)
print(f"{green}[*] Acceptable answers >>> {ANS}")
sleep(1)
AddCaption=input(f"{yellow}[?] Add caption >>> ").lower()
if AddCaption == ANS[0]:
default = 'Check out my new story !'
print(f"{yellow}[+] Default >>> {default}")
sleep(1)
print(f"{yellow}[*] Hit <Enter> to apply the default option")
sleep(2)
caption=input(f"{yellow}[::] Caption >>> ")
while caption in NULL:
print(f"{red}[✕] This field can't be blank !")
sleep(1)
caption=input(f"{yellow}[::] Caption >>> ")
if caption == '':
caption = default
else:
caption=input(f"{yellow}[::] Caption >>> ")
while caption in NULL:
print(f"{red}[✕] This field can't be blank !")
sleep(1)
caption=input(f"{yellow}[::] Caption >>> ")
sleep(1)
print(f"{green}[*] Acceptable answers >>> {ANS}")
sleep(1)
AddMention=input(f"{yellow}[?] Tag other users >>> ")
while AddMention.lower() not in ANS or AddMention in NULL:
if AddMention in NULL:
print(f"{red}[✕] This field can't be blank !")
else:
print(f"{red}[!] Invalid input !")
sleep(1)
print(f"{green}[*] Acceptable answers: {ANS}")
sleep(1)
mention=input(f"{yellow}[?] Tag other users >>> ")