forked from InstaPy/InstaPy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUnFollow.py
54 lines (49 loc) · 1.74 KB
/
UnFollow.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
from instapy import InstaPy
from random import shuffle
from instapy.unfollow_util import dump_follow_restriction
import pickle
import sys
with open('./logs/user.txt', 'r') as file:
insta_username = file.readline()
print(insta_username)
with open('./logs/password.txt', 'r') as file:
insta_password = file.readline()
with open('./logs/all_following.pkl', 'rb') as input:
original_all_following = pickle.load(input)
print ("original_all_following users to ignore", len(original_all_following))
print("1")
import schedule
import time
def job():
try:
#create instance
session = InstaPy(username=insta_username, password=insta_password, passwordinput = sys.argv[0])
session.login()
#limits
session.set_dont_include(original_all_following)
# start the process
#session.set_dont_unfollow_active_users(enabled=True, posts=2)
session.unfollow_users(amount=100, onlyInstapyFollowed=True, onlyInstapyMethod='FIFO', sleep_delay=440 )
# end the bot session
session.end()
except KeyboardInterrupt:
session.end()
except:
import traceback
print(traceback.format_exc())
schedule.every().day.at("06:22").do(job)
schedule.every().day.at("07:20").do(job)
schedule.every().day.at("08:05").do(job)
schedule.every().day.at("10:23").do(job)
schedule.every().day.at("12:08").do(job)
schedule.every().day.at("13:02").do(job)
schedule.every().day.at("14:13").do(job)
schedule.every().day.at("15:33").do(job)
schedule.every().day.at("16:25").do(job)
schedule.every().day.at("17:28").do(job)
schedule.every().day.at("18:29").do(job)
schedule.every().day.at("19:00").do(job)
schedule.every().day.at("20:25").do(job)
while True:
schedule.run_pending()
time.sleep(1)