You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: Added Two Factor Authentication feature, intended for protected
accts. If the acct is not protected this feature will be ignored, will
go unnoticed.
Fixed timgrossmann#5932, Commenting with '@{}' inserts my own username instead of the
target's username
comment_util.py: replaced unused variables in process_comments()
instapy.py: added `security_codes` arg in constructor and login_user()
process_comments() now uses `user_name` for commenting a
target user.
comment_by_locations() now has the same code for process_comments()
login_util.py: Added random import due to login_user() feature with Two Factor
Authentication. security_codes, must be a list with codes
and InstaPy will chose only one element randomly.
Added new def two_factor_authentication()
xpath_compile.py: Updated get_comments_on_post xpath with a generic form
Added pull_request_template.md: to have a format in the PR.
instance-settings.md updated with steps for Two Factor Authentication
Updated CHANGELOG with commit changes
Note:
<!-- Did you know that we have a Discord channel ? Join us: https://discord.gg/FDETsht -->
2
+
<!-- Is this a Feature Request ? Please, check out our Wiki first https://github.com/timgrossmann/InstaPy/wiki -->
3
+
# Pull Request Template
4
+
5
+
## Description
6
+
7
+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
8
+
9
+
Do not include any personal data.
10
+
11
+
Fixes # (issue)
12
+
13
+
## How Has This Been Tested?
14
+
15
+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
16
+
17
+
-[ ] Test
18
+
19
+
## Checklist:
20
+
21
+
-[ ] I have commented my code, particularly in hard-to-understand areas
22
+
-[ ] I have made corresponding changes to the documentation
23
+
-[ ] I have checked my code and corrected any misspellings
24
+
-[ ] I have performed a self-review of my own code
25
+
-[ ] My code follows the style guidelines of this project, `black -t py34`
InstaPy detects automatically if the account is protected with the Two Factor Authentication, if yes InstaPy user need to provide the Security codes in the session constructor; at least one code is required.
40
+
41
+
Security codes can be found in: `Settings` -> `Security` -> `Two-Factor-Authentication` -> `Backup Codes`
You can use InstaPy behind a proxy by specifying server address, port and/or proxy authentication credentials. It works with and without ```headless_browser``` option.
42
52
43
53
Simple proxy setup example:
54
+
44
55
```python
45
56
session = InstaPy(username=insta_username,
46
57
password=insta_password,
47
-
proxy_address='8.8.8.8',
48
-
proxy_port=8080)
49
-
58
+
proxy_address='8.8.8.8',
59
+
proxy_port=8080)
50
60
```
51
61
52
62
Proxy setup with authentication example:
63
+
53
64
```python
54
65
session = InstaPy(username=insta_username,
55
66
password=insta_password,
@@ -64,7 +75,8 @@ InstaPy can perform a few checks online, including you connection and the availa
64
75
65
76
`want_check_browser` default is False, you can set it to True at session start. Recommend to do this if you want to add additional checks for the connection to the web and Instagram.
66
77
67
-
example:
78
+
For example:
79
+
68
80
```python
69
81
session = InstaPy(username=insta_username,
70
82
password=insta_password,
@@ -76,15 +88,16 @@ If you're running InstaPy in threads and get exception `ValueError: signal only
76
88
There is two ways to do it:
77
89
78
90
Closing session in smart_run context:
91
+
79
92
```python
80
93
session = InstaPy()
81
94
with smart_run(session, threaded=True):
82
95
""" Activity flow """
83
96
# some activity here ...
84
97
```
85
98
86
-
87
99
Closing session with `end()` method
100
+
88
101
```python
89
102
session = InstaPy()
90
103
session.login()
@@ -99,7 +112,8 @@ Specifying the Firefox executable path can also help you if you are getting the
99
112
100
113
`selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities`
101
114
102
-
example on a Windows machine (with the right path also works on Linux and MAC)
115
+
Example on a Windows machine (with the right path also works on Linux and macOS)
0 commit comments