-
Notifications
You must be signed in to change notification settings - Fork 0
/
IAM.py
4089 lines (3982 loc) · 173 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
[-->] 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(0)
import platform
from tqdm import tqdm
total_mods = 11
bar = tqdm(total=total_mods, desc='Loading modules', unit='module')
for _ in range(total_mods):
sleep(0.75)
bar.update(1)
bar.close()
from os import system
import instagrapi
import json
import instaloader
import requests as re
import os
from tkinter import *
except ImportError or 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(f"[*] Error message ==> {ex}")
sleep(2)
print("[1] Uninstall script")
print("[2] Exit")
opt=int(input("[>] Please enter a number (from the above ones): "))
while opt < 1 or opt > 2 or opt == None:
if opt == None:
print("[!] This field can't be blank !")
else:
print("[!] Invalid number !")
sleep(1)
print("[*] Acceptable numbers: [1/2]")
sleep(1)
print("[1] Uninstall script")
print("[2] Exit")
opt=int(input("[>] 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))
return None
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 👋")
quit(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()
print("[✓] Successfully loaded modules !")
sleep(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))
return None
def banner() -> str:
return """
██╗░█████╗░███╗░░░███╗
██║██╔══██╗████╗░████║
██║███████║██╔████╔██║
██║██╔══██║██║╚██╔╝██║
██║██║░░██║██║░╚═╝░██║
╚═╝╚═╝░░╚═╝╚═╝░░░░░╚═╝
"""
def clear():
if platform.system() == 'Windows':
system('cls')
else:
system('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}/").status_code != 200
def Except(ex:str):
print("[!] Error !")
sleep(1)
print(f"[*] Error message ==> {ex}")
sleep(2)
print("[1] Return to menu")
print("[2] Exit")
num=int(input("[::] Please enter a number (from the above ones): "))
while num < 1 or num > 2 or num == None:
if num == None:
print("[!] This field can't be empty !")
else:
print("[!] Invalid number !")
sleep(1)
print("[*] Acceptable numbers: [1/2]")
sleep(1)
print("[1] Return to menu")
print("[2] Exit")
num=int(input("[::] Please enter a number (from the above ones): "))
if num == 1:
main()
else:
print("[+] Exiting...")
sleep(1)
print("[+] See you next time 👋")
sleep(1)
quit(0)
def checkOpt(opt,data):
if data == "username":
if opt == None:
print("[!] This field can't be empty !")
else:
print("[!] Invalid length !")
sleep(1)
print("[*] Acceptable length: less than or equal to 30 characters")
elif data == "id":
if opt == None:
print("[!] This field can't be empty !")
else:
print("[!] Invalid length !")
sleep(1)
print("[*] Acceptable length: greater than 3")
elif data == "path":
if opt == None:
print("[!] This field can't be empty !")
else:
print("[!] Path must contain: / or \ ")
else:
if opt == None:
print("[!] This field can't be empty !")
else:
print("[!] Invalid number !")
def valOpt(opt:int,x:int,y:int):
return opt < x or opt > y or opt == None
def CheckVal() -> str:
print("[!] User not found !")
sleep(1)
print("[1] Try with another username")
print("[2] Return to menu")
print("[3] Exit")
opt=int(input("[::] Please enter a number (from the above ones): "))
while valOpt(opt,1,3):
checkOpt(opt, 'other')
sleep(1)
print("[1] Try with another username")
print("[2] Return to menu")
print("[3] Exit")
opt=int(input("[::] Please enter again a number (from the above ones): "))
if opt == 1:
username=str(input("[::] Please enter the username: "))
while checkUser(username):
checkOpt(opt, 'username')
sleep(1)
username=str(input("[::] Please enter again the username: "))
return username
elif opt == 2:
main()
else:
print("[+] Thank you for using my script 😁")
sleep(2)
print("[+] See you next time 👋")
sleep(1)
quit(0)
return False
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 "[✓] Files and dependencies uninstalled successfully !"
def Next() -> int:
sleep(1)
print("[1] Return to menu")
print("[2] Exit")
opt=int(input("[::] Please enter a number (from the above ones): "))
while valOpt(opt,1,2):
if opt == None:
print("[!] This field can't be blank !")
else:
print("[!] Invalid number !")
sleep(1)
print("[*] Acceptable numbers: [1/2]")
sleep(1)
opt=int(input("[::] Please enter a number (from the above ones): "))
return opt
def Class():
main() if Next() == 1 else Exiting()
def Exiting():
print("[+] Exiting...")
sleep(1)
print("[+] See you next time 👋")
sleep(1)
quit(0)
def checkCount(num: int) -> bool:
return num == None or num < 1
def checkTag(tag: str) -> bool:
return "#" in tag or tag == None or tag == ''
def checkPath(path: str) -> bool:
return path == None or "/" not in path or "\\" not in path or path == ''
def Av_Acts() -> str:
return """
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)
7) Accept follow request(s)
8) Reject follow request(s)
9) Follow user's followers
10) Follow user's following
11) Send DM (Direct Message)
12) Send file
13) Send photo
14) Send video
15) Like the posts from hashtag(s)
16) Like the posts from user(s)
17 Like the posts from location(s)
18) Like the posts from feed
19) Comment by user
20) Set default reply to comments
21) Do comment
22) Block user(s)
23) Delete story
24) Like/Unlike (post(s), reel(s), igtv(s) etc.)
25) Delete your (post(s), reel(s), igtv(s) etc.)
26) Save/Unsave (post(s), reel(s), igtv(s) etc.)
"""
def ScriptInfo():
with open('config.json') as config:
conf = json.load(config)
f = conf['name'] + '.py'
if os.path.exists(fpath(f)):
fsize = os.stat(fpath(f)).st_size
else:
fsize = 0
print(f"[+] Author ==> {conf['author']}")
print(f"[+] Github ==> @{conf['author']}")
print(f"[+] License ==> {conf['lice']}")
print(f"[+] Script's name ==> {conf['name']}")
print(f"[+] Script's version ==> {conf['version']}")
print(f"[+] Programming language(s) used ==> {conf['lang']}")
print(f"[+] Natural language ==> {conf['language']}")
print(f"[+] File size ==> {fsize} bytes")
print(f"[+] File path ==> {fpath(f)}")
print(f"[+] Number of lines ==> {conf['lines']}")
print(f"[+] API(s) used ==> {conf['api']}")
print("|======|GITHUB REPO INFO|======|")
print(f"[+] Stars ==> {conf['stars']}")
print(f"[+] Forks ==> {conf['forks']}")
print(f"[+] Open issues ==> {conf['issues']}")
print(f"[+] Closed issues ==> {conf['clissues']}")
print(f"[+] Open pull requests ==> {conf['prs']}")
print(f"[+] Closed pull requests ==> {conf['clprs']}")
print(f"[+] Discussions ==> {conf['discs']}")
def checkUser(username: str) -> bool:
return username == None or len(username) > 30 or username == ''
def GetID(username: str) -> int:
return loader.check_profile_id(username)
def checkID(id: int) -> bool:
return id == None or len(id) < 3
ANS = ['yes','no']
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 = None
sktp = None
count = 0
def main():
print(banner())
print("\n")
print("[+] IAM: Instagram Account Manager")
print("\n")
print("[+] Script for Managing your Instagram Account Remotely")
print("\n")
print("[+] Author: new92")
print("[+] Github: @new92")
print("\n")
print("[1] Display your profile ID")
print("[2] Display your security information")
print("[3] Display your account info")
print("[4] Display your pending follow requests")
print("[5] Display your followers")
print("[6] Display the users you Follow")
print("\n")
print("[7] Download your highlights")
print("[8] Download anonymous stories of other users")
print("[9] Download your saved posts")
print("[10] Download posts from your feed")
print("\n")
print("[11] Publish post(s)")
print("[12] Enable/Disable your notifications")
print("[13] Change profile pic")
print("[14] Upload story with pic")
print("[15] Publish IGTV video")
print("\n")
print("[16] Follow user(s)")
print("[17] Unfollow user(s)")
print("[18] Accept follow request(s)")
print("[19] Reject follow request(s)")
print("[20] Follow user's followers")
print("[21] Follow user's following")
print("\n")
print("[22] Send DM (Direct Message)")
print("[23] Send file")
print("[24] Send photo")
print("[25] Send video")
print("\n")
print("[26] Like the posts from hashtag(s)")
print("[27] Like the posts from user(s)")
print("[28] Like the posts from location(s)")
print("[29] Like the posts from feed")
print("\n")
print("[30] Comment by user")
print("[31] Set default reply to comments")
print("[32] Do comment")
print("\n")
print("[33] Block User(s)")
print("[34] Get username from user ID")
print("[35] Get a list of all users you have blocked")
print("\n")
print("[36] Create highlight(s)")
print("[37] Delete highlight(s)")
print("[38] Change the cover of highlight(s)")
print("[39] Display the highlights of user(s)")
print("[40] Retrieve information from highlight(s)")
print("\n")
print("[41] Delete story")
print("[42] Get story viewers")
print("[43] Get stories by hashtags")
print("[44] Get stories by users")
print("[45] Retrieve information of a story")
print("\n")
print("[46] Set country")
print("[47] Set bio")
print("[48] Gather information for a user (works better on public accounts)")
print("[49] Get information about posts where user is tagged")
print("[50] Reset your password")
print("\n")
print("[51] Edit profile")
print("[52] Like/Unlike (post(s), reel(s), igtv(s) etc.)")
print("[53] Delete your (post(s), reel(s), igtv(s) etc.)")
print("[54] Save/Unsave (post(s), reel(s), igtv(s) etc.)")
print("\n")
print("[55] Set a specific time (from the current day) to execute an action")
print("\n")
print("[56] Hide your stories from a specific user")
print("\n")
print("[57] Uninstall script")
print("\n")
print("[999] Show program info and exit")
print("\n")
print("[0] Exit")
print("\n")
option=int(input("[::] Please enter a number (from the above ones): "))
while valOpt(option,1,57) and opt != 999:
checkOpt(option, "other")
sleep(2)
print("[1] Display your profile ID")
print("[2] Display your security information")
print("[3] Display your account info")
print("[4] Display your pending follow requests")
print("[5] Display your followers")
print("[6] Display the users you Follow")
print("\n")
print("[7] Download your highlights")
print("[8] Download anonymous stories of other users")
print("[9] Download your saved posts")
print("[10] Download posts from your feed")
print("\n")
print("[11] Publish post(s)")
print("[12] Enable/Disable your notifications")
print("[13] Change profile pic")
print("[14] Upload story with pic")
print("[15] Publish IGTV video")
print("\n")
print("[16] Follow user(s)")
print("[17] Unfollow user(s)")
print("[18] Accept follow request(s)")
print("[19] Reject follow request(s)")
print("[20] Follow user's followers")
print("[21] Follow user's following")
print("\n")
print("[22] Send DM (Direct Message)")
print("[23] Send file")
print("[24] Send photo")
print("[25] Send video")
print("\n")
print("[26] Like the posts from hashtag(s)")
print("[27] Like the posts from user(s)")
print("[28] Like the posts from location(s)")
print("[29] Like the posts from feed")
print("\n")
print("[30] Comment by user")
print("[31] Set default reply to comments")
print("[32] Do comment")
print("\n")
print("[33] Block User(s)")
print("[34] Get username from user ID")
print("[35] Get a list of all users you have blocked")
print("\n")
print("[36] Create highlight(s)")
print("[37] Delete highlight(s)")
print("[38] Change the cover of highlight(s)")
print("[39] Display the highlights of user(s)")
print("[40] Retrieve information from highlight(s)")
print("\n")
print("[41] Delete story")
print("[42] Get story viewers")
print("[43] Get stories by hashtags")
print("[44] Get stories by users")
print("[45] Retrieve information of a story")
print("\n")
print("[46] Set country")
print("[47] Set bio")
print("[48] Gather information for a user (works better on public accounts)")
print("[49] Get information about posts where user is tagged")
print("[50] Reset your password")
print("\n")
print("[51] Edit profile")
print("[52] Like/Unlike (post(s), reel(s), igtv(s) etc.)")
print("[53] Delete your (post(s), reel(s), igtv(s) etc.)")
print("[54] Save/Unsave (post(s), reel(s), igtv(s) etc.)")
print("\n")
print("[55] Set a specific time (from the current day) to execute an action")
print("\n")
print("[56] Hide your stories from a specific user")
print("\n")
print("[57] Uninstall script")
print("\n")
print("[999] Show program info and exit")
print("\n")
print("[0] Exit")
option=int(input("[::] Please enter again a number (from the above ones): "))
if option != 0:
clear()
print("\n")
print("|--------------------|LOGIN|--------------------|")
print("\n")
username=str(input("[::] Please enter your username: "))
while checkUser(username):
checkOpt(username, "username")
sleep(1)
username=str(input("[::] Please enter again your username: "))
while valUser(username):
if type(CheckVal()) == bool:
CheckVal()
else:
username = CheckVal()
username = username.lower().strip()
password=str(input("[::] Please enter your password: "))
while password == None or password == '' :
print("[!] This field can't be blank !")
sleep(1)
password=input("[::] Please enter again your password: ")
password = password.strip()
try:
loginl = loader.login(username,password)
loginc = client.login(username,password,True)
logini = instapy.InstaPy(username,password)
api = instagram_private_api.Client(username,password)
except Exception as ex:
Except(ex)
elif option == 999:
clear()
ScriptInfo()
if option == 0:
clear()
print("[+] Thank you for using my script 😁")
sleep(2)
print("[+] See you next time 👋")
sleep(1)
quit(0)
elif option == 1:
clear()
try:
print(f"[+] Your ID: {GetID(username)}")
Class()
except Exception as ex:
Except(ex)
elif option == 2:
clear()
try:
sec=client.account_security_info()
print(f"[+] Is phone confirmed ? {sec['is_phone_confirmed']}")
print(f"[+] Is 2 factor authentication enabled ? {sec['is_two_factor_enabled']}")
print(f"[+] Is Time-based One-Time Passwords (TOTP) 2 factor authentication enabled ? {sec['is_totp_two_factor_enabled']}")
print(f"[+] Is trusted notifications enabled ? {sec['is_trusted_notifications_enabled']}")
print(f"[+] Is eligible for Whatsapp 2 factor authentication ? {sec['is_eligible_for_whatsapp_two_factor']}")
print(f"[+] Is Whatsapp 2 factor authentication enabled ? {sec['is_whatsapp_two_factor_enabled']}")
print(f"[+] Backup codes: {sec['backup_codes']}")
print(f"[+] Trusted devices: {sec['trusted_devices']}")
print(f"[+] Has reachable email ? {sec['has_reachable_email']}")
print(f"[+] Is eligible for trusted notifications ? {sec['eligible_for_trusted_notifications']}")
print(f"[+] Is eligible for multiple TOTP ? {sec['is_eligible_for_multiple_totp']}")
print(f"[+] TOTP seeds: {sec['totp_seeds']}")
print(f"[+] Can add additional TOTP seed ? {sec['can_add_additional_totp_seed']}")
Class()
except Exception as ex:
Except(ex)
elif option == 3:
clear()
try:
print(f"[+] Your account information: {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("[::] Please enter your id as shown above: "))
while checkID(id):
checkOpt(id, "id")
sleep(1)
id=int(input("[::] Please enter again your 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("[::] Please enter your id (as shown above): "))
while checkID(id):
checkOpt(id,"id")
sleep(1)
id=input("[::] Please enter again your 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("[::] Please enter your id as shown above: "))
while checkID(id):
checkOpt(id,"id")
sleep(1)
id=int(input("[::] Please enter again your id as shown above: "))
try:
highlights=loader.download_highlights(id)
sleep(1)
print(f"[+] Highlights folder path: {fpath(highlights)}")
Class()
except Exception as ex:
Except(ex)
elif option == 8:
clear()
count=int(input("[+] Number of accounts (to get their stories): "))
while valOpt(count,1,999):
checkOpt(count,'other')
sleep(1)
count=int(input("[::] Please enter again the number of accounts (to get their stories): "))
for i in range(count):
username=str(input("[::] Please enter the username: "))
while checkUser(username):
checkOpt(username, "username")
sleep(1)
username=str(input("[::] Please enter again the username: "))
while valUser(username):
if type(CheckVal()) == bool:
CheckVal()
else:
username = CheckVal()
username = username.lower().strip()
print(GetID(username))
id=int(input("[::] Please enter the ID as shown above: "))
while checkID(id):
checkOpt(id,"id")
sleep(1)
id=int(input("[::] Please enter again the ID as shown above: "))
IDS.append(id)
try:
loader.download_stories(IDS)
sleep(2)
print(f"[+] Path to folder containing the stories: {fpath(':stories')}")
Class()
except Exception as ex:
Except(ex)
elif option == 9:
clear()
count=int(input("[?] How many of your saved posts do you want to download ? "))
while checkCount(count):
checkOpt(count, "other")
sleep(1)
count=int(input("[?] How many of your saved posts do you want to download ? "))
try:
loader.download_saved_posts(count)
print(f"[+] Path to folder containing saved posts: {fpath(':saved')}")
Class()
except Exception as ex:
Except(ex)
elif option == 10:
clear()
count=int(input("[?] How many posts do you want to download ? "))
while checkCount(count):
checkOpt(count, "other")
sleep(1)
count=int(input("[?] How many posts do you want to download ? "))
try:
loader.download_feed_posts(count)
print(f"[+] Path to folder containing feed posts: {fpath(':feed')}")
Class()
except Exception as ex:
Except(ex)
elif option == 11:
clear()
count=int(input("[::] Please enter the number of posts to post: "))
while checkCount(count):
checkOpt(count, "other")
sleep(1)
count=int(input("[::] Please enter again the number of posts to post: "))
for i in range(count):
path=str(input("[::] Please enter the path to the photo to be uploaded: "))
while checkPath(path):
checkOpt(path, "path")
sleep(1)
path=str(input("[::] Please enter again the path to the photo to be uploaded: "))
sleep(2)
print(">>>CAPTION<<<")
sleep(1)
print("[+] Default: \"Check out my new post !\"")
sleep(2)
print("[*] Hit <Tab> and <Enter> to apply the default caption")
sleep(2)
caption=str(input("[::] Please enter the caption: "))
if caption == "\t":
caption = "Check out my new post !"
print(">>>TAGS<<<")
sleep(2)
print("[+] Default: [No]")
sleep(2)
print("[*] Hit <Tab> and <Enter> to apply the default option")
sleep(2)
print("[*] Acceptable answers: [yes/no]")
sleep(2)
tags=str(input("[?] Do you want to include other users to your post by tagging them ? "))
while tags.lower() not in ANS or tags == None or tags == '':
if tags == None or tags == '':
print("[!] This field can't be empty !")
else:
print("[!] Invalid answer !")
sleep(1)
print("[*] Acceptable answers: [yes/no]")
sleep(1)
tags=str(input("[?] Do you want to include other users to your post by tagging them ? "))
if tags.lower() == ANS[0]:
print("[+] Default: 1")
sleep(2)
print("[*] Please enter 'def' to apply the default option")
sleep(1)
count=input("[?] How many users do you want to include ? ")
if count == 'def':
username=str(input("[::] Please enter the username: "))
while checkUser(username):
checkOpt(username, "username")
sleep(1)
username=str(input("[::] Please enter again the username: "))
while valUser(username):
CheckVal()
username = username.lower().strip()
else:
while checkCount(count):
checkOpt(count,"other")
sleep(1)
count=int(input("[?] How many users do you want to tag ? "))
for i in range(count):
utag=str(input(f"[::] Please enter the username No{i+1}: "))
while checkUser(utag):
checkOpt(utag,"username")
sleep(1)
utag=str(input(f"[::] Please enter again the username No{i+1}: "))
while valUser(utag):
CheckVal()
utag = utag.strip().lower()
TaggedUsers.append(utag)
print(">>>LOCATION<<<")
sleep(2)
print("[+] Default: [No]")
sleep(1)
print("[*] Please enter 'def' to apply the default option")
sleep(2)
print("[*] Acceptable answers: [yes/no]")
sleep(1)
loc=str(input("[?] Do you want to include location(s) ? "))
while (loc.lower() not in ANS or loc == None or loc == '') and loc != 'def':
if loc == None or loc == '':
print("[!] This field can't be blank !")
else:
print("[!] Invalid location !")
sleep(1)
print("[*] Acceptable answers: [yes/no]")
sleep(1)
loc=str(input("[?] Do you want to include location(s) ? "))
if loc.lower() == ANS[0]:
count=int(input("[?] How many ? "))
while checkCount(count):
checkOpt(count,"other")
sleep(1)
count=int(input("[?] How many locations do you want to include ? "))
for i in range(count):
location=str(input(f"[::] Please enter location No{i+1}: "))
while location == None or location == '':
print("[!] This field can't be blank !")
sleep(1)
location=str(input(f"[::] Please enter again location No{i+1}: "))
LOCATIONS.append(location)
print("[✓] Location added !")
try:
client.photo_upload(path=path,caption=caption,usertags=TaggedUsers,location=LOCATIONS)
sleep(2)
print("[✓] Photo uploaded !")
Class()
except Exception as ex:
Except(ex)
if tags.lower() in ANS and loc.lower() in ANS:
try:
client.photo_upload(path=path,caption=caption,usertags=TaggedUsers,location=LOCATIONS)
sleep(2)
print("[✓] Photo uploaded !")
Class()
except Exception as ex:
Except(ex)
elif tags.lower() in ANS and loc.lower() in ANS:
try:
client.photo_upload(path=path,caption=caption,tags=TaggedUsers)
sleep(2)
print("[✓] Photo uploaded !")
Class()
except Exception as ex:
Except(ex)
elif tags.lower() in ANS and loc.lower() in ANS:
try:
client.photo_upload(path=path,caption=caption,location=LOCATIONS)
sleep(2)
print("[✓] Photo uploaded !")
Class()
except Exception as ex:
Except(ex)
elif tags.lower() in ANS and loc.lower() in ANS:
try:
client.photo_upload(path=path,caption=caption)
sleep(2)
print("[✓] Photo uploaded !")
Class()
except Exception as ex:
Except(ex)
elif option == 12:
clear()
username=str(input("[::] Please enter your username: "))
while checkUser(username):
checkOpt(username, "username")
sleep(1)
username=str(input("[::] Please enter again your username: "))
while valUser(username):
CheckVal()
username = username.lower().strip()
EN = ["enable","disable"]
print("[*] Acceptable answers: [enable/disable]")
sleep(1)
endis=str(input("[?] Do you want to enable or disable your notifications ? "))
while endis.lower() not in EN or endis == None or endis == '':
if endis == None or endis == '':
print("[!] This field can't be blank !")
else:
print("[!] Invalid input !")
sleep(1)
print("[*] Acceptable answers: [enable/disable]")
sleep(1)
endis=input("[?] Do you want to enable or disable your notifications ? ")
if endis.lower() == EN[0]:
username=str(input("[::] Please enter your username: "))
while checkUser(username):
checkOpt(username, "username")
sleep(1)
username=str(input("[::] Please enter again your username: "))
while valUser(username):
CheckVal()
username = username.lower().strip()
print("[*] Notifications available for: [posts/reels/stories/videos]")
sleep(2)
action=str(input("[?] Which notifications do you want to enable ?"))
while action.lower() not in ["posts","reels","stories","videos"] or action == None or action == '':
if action == None or action == '':
print("[!] This field can't be blank !")
else:
print("[!] Invalid input !")
sleep(1)
print("[*] Acceptable answers: [posts/reels/stories/videos]")
sleep(1)
action=input("[?] Please enter again the notifications to enable: ")
if action.lower() == "posts":
username=str(input("[::] Please enter your username: "))
while checkUser(username):
checkOpt(username, "username")
sleep(1)
username=str(input("[::] Please enter again your username: "))
while valUser(username):
CheckVal()
username = username.lower().strip()
print(GetID(username))
uid=int(input("[::] Please enter the ID as shown above: "))
while checkID(uid):
checkOpt(uid, "id")
sleep(1)
uid=int(input("[::] Please enter again the ID as shown above: "))
try:
enabled = client.enable_posts_notifications(uid)
if enabled:
print("[✓] Post notifications enabled !")
else:
print("[✕] Can't enable post notifications !")
Class()
except Exception as ex:
Except(ex)
elif action.lower() == "reels":
username=str(input("[::] Please enter your username: "))
while checkUser(username):
checkOpt(username, "username")
sleep(1)
username=str(input("[::] Please enter again your username: "))
while valUser(username):
CheckVal()
username = username.lower().strip()
print(GetID(username))
uid=int(input("[::] Please enter your ID as shown above: "))
while checkID(uid):
checkOpt(uid, "id")
sleep(1)
uid=int(input("[::] Please enter again your ID as shown above: "))
try:
enabled = client.enable_reels_notifications(uid)
if enabled:
print("[✓] Reels notifications enabled !")
else:
print("[✕] Can't enable reels notifications !")
Class()
except Exception as ex:
Except(ex)
elif action.lower() == "stories":
username=str(input("[::] Please enter your username: "))
while checkUser(username):
checkOpt(username, "username")
sleep(1)
username=str(input("[::] Please enter again your username: "))
while valUser(username):
CheckVal()
username = username.lower().strip()
print(GetID(username))
uid=int(input("[::] Please enter the ID as shown above: "))
while checkID(uid):
print("[!] Invalid ID !")
sleep(1)
uid=int(input("[::] Please enter again the ID as shown above: "))
try: