-
Notifications
You must be signed in to change notification settings - Fork 31
/
run.py
36 lines (27 loc) · 869 Bytes
/
run.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
import json
import random
from src.instadm import InstaDM
f = open('infos/accounts.json',)
accounts = json.load(f)
with open('infos/usernames.txt', 'r') as f:
usernames = [line.strip() for line in f]
with open('infos/messages.txt', 'r') as f:
messages = [line.strip() for line in f]
while True:
if not usernames:
print('Finished usernames.')
break
for account in accounts:
if not usernames:
break
# Auto login
insta = InstaDM(username=account["username"],
password=account["password"], headless=False)
for i in range(10):
if not usernames:
break
username = usernames.pop()
# Send message
insta.sendMessage(
user=username, message=random.choice(messages))
insta.teardown()