Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from instapy import InstaPy
|
3 |
+
import time
|
4 |
+
import subprocess
|
5 |
+
|
6 |
+
|
7 |
+
def run_instagram_bot():
|
8 |
+
# Initialize InstaPy
|
9 |
+
session = InstaPy(username="<your_username>", password="<your_password>")
|
10 |
+
|
11 |
+
# Set up your bot preferences
|
12 |
+
# Enable story interaction
|
13 |
+
session.set_do_story(enabled=True, percentage=100)
|
14 |
+
session.set_do_comment(enabled=True, percentage=100) # Enable commenting
|
15 |
+
# Customize comments
|
16 |
+
session.set_comments(
|
17 |
+
["Nice!", "نام من فرید است و سلام به شما امیدوارم موفق باشید", "Amazing!", "🔥", "Hello My Name Is Farid :)...", "کارت عالی بود", "تو بهترینی", "اطلاعات شگفت انگیز"])
|
18 |
+
|
19 |
+
# Log in
|
20 |
+
session.login()
|
21 |
+
|
22 |
+
while True:
|
23 |
+
# Like stories
|
24 |
+
session.like_stories(amount=10) # Like 10 stories (adjust as needed)
|
25 |
+
|
26 |
+
# Reply to stories
|
27 |
+
session.reply_to_stories(["👍", "🔥"]) # Customize your replies
|
28 |
+
|
29 |
+
# Gain followers
|
30 |
+
# Follow followers of specific users
|
31 |
+
session.follow_user_followers(
|
32 |
+
["user1", "user2"], amount=5, randomize=True)
|
33 |
+
|
34 |
+
# Wait for 1 minute before the next iteration
|
35 |
+
time.sleep(60)
|
36 |
+
|
37 |
+
|
38 |
+
def trigger_instagram_bot():
|
39 |
+
# Run the extended Instagram bot script
|
40 |
+
subprocess.Popen(["python", "instagram_bot_combined.py"])
|
41 |
+
|
42 |
+
return "Instagram bot started! It will like stories, leave comments, gain followers, and run every minute."
|
43 |
+
|
44 |
+
|
45 |
+
iface = gr.Interface(
|
46 |
+
fn=trigger_instagram_bot,
|
47 |
+
inputs=None,
|
48 |
+
outputs=gr.outputs.Textbox(label="Bot Status"),
|
49 |
+
title="Instagram Bot: Auto Like, Comment, Follow & Schedule",
|
50 |
+
description="Click the button to start the extended bot!",
|
51 |
+
)
|
52 |
+
|
53 |
+
if __name__ == "__main__":
|
54 |
+
iface.launch()
|