forked from domabyte/FocusFeed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
45 lines (37 loc) · 1.11 KB
/
main.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
from src.auth import Authenticator
import instaloader
import sys
class InstagramBot:
def __init__(self):
self.auth = Authenticator()
self.loader = None
def display_menu(self):
print("\nInstagram Bot")
print("1. Login")
print("2. Logout")
print("3. Perform Operations")
print("4. Exit")
return input("Choose an option (1-4): ")
def run(self):
try:
while True:
choice = self.display_menu()
if choice == "1":
self.auth.login()
elif choice == "2":
self.auth.logout()
elif choice == "3":
self.auth.perform_operations()
elif choice == "4":
print("Exiting...")
sys.exit(0)
else:
print("Invalid option. Please try again.")
except KeyboardInterrupt:
print("\nProgram interrupted. Exiting...")
sys.exit(0)
def main():
bot = InstagramBot()
bot.run()
if __name__ == "__main__":
main()