-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
72 lines (72 loc) · 2.59 KB
/
main.py
File metadata and controls
72 lines (72 loc) · 2.59 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
from instagram_class import InstagramApi
import time, random
menu = """
1.) Auto like timeline
2.) Auto view story timeline
3.) Auto like & views timeline
"""
print(menu)
choice = int(input("Choice: "))
username = input("Username: ")
password = input("Password: ")
delay = int(input("Delay (Seconds): "))
user = InstagramApi(username, password)
login = user.logIn()
if login["status"] == "success":
if choice == 1:
while(True):
try:
timeline_id = user.getHome()
for like in timeline_id:
likee = user.likePost(like)
if likee == False:
user.logIn()
time.sleep(random.randint(4, 7))
except Exception as E:
print(E)
print("Error!")
print("Sleeping for %s seconds"%(delay))
time.sleep(delay)
elif choice == 2:
while(True):
try:
story_id = user.getStory()
for story in story_id:
print("Viewing story @%s"%(story["username"]))
seen = user.seenStory(story["reelid"], story["user_id"], story["taken_at"])
if seen == False:
user.logIn()
time.sleep(random.randint(4, 7))
except:
print("Error!")
print("Sleeping for %s seconds"%(delay))
time.sleep(delay)
elif choice == 3:
while(True):
try:
print("="*10 + " [STORY VIEWS] " + "="*10)
story_id = user.getStory()
for story in story_id:
print("Viewing story @%s"%(story["username"]))
seen = user.seenStory(story["reelid"], story["user_id"], story["taken_at"])
if seen == False:
user.logIn()
time.sleep(random.randint(5, 10))
print("Sleeping for %s seconds"%(delay))
time.sleep(delay)
#################################################
print("="*10 + " [TIMELINE LIKE] " + "="*10)
timeline_id = user.getHome()
for like in timeline_id:
likee = user.likePost(like)
if likee == False:
user.logIn()
time.sleep(random.randint(5, 10))
print("Sleeping for %s seconds"%(delay))
time.sleep(delay)
except:
print("Error!")
else:
print("Error no option!")
else:
print(login)