forked from InstaPy/InstaPy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickstart.py
More file actions
39 lines (29 loc) · 1.05 KB
/
quickstart.py
File metadata and controls
39 lines (29 loc) · 1.05 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
import traceback
from instapy import InstaPy
insta_username = ''
insta_password = ''
# set headless_browser=True if you want to run InstaPy on a server
# set these in instapy/settings.py if you're locating the
# library in the /usr/lib/pythonX.X/ directory:
# Settings.database_location = '/path/to/instapy.db'
# Settings.chromedriver_location = '/path/to/chromedriver'
session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=False,
multi_logs=True)
try:
session.login()
# settings
session.set_upper_follower_count(limit=2500)
session.set_do_comment(True, percentage=10)
session.set_comments(['aMEIzing!', 'So much fun!!', 'Nicey!'])
session.set_dont_include(['friend1', 'friend2', 'friend3'])
session.set_dont_like(['pizza', 'girl'])
# actions
session.like_by_tags(['natgeo'], amount=1)
except Exception as exc:
# full stacktrace when raising Github issue
traceback.print_exc(exc)
finally:
# end the bot session
session.end()