-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor code to add config feature.
Move InstaGPy class constructor arguments to a config.py file. Configurations can now be changed by importing the config file to the project.\n\n from instagpy import config
- Loading branch information
1 parent
4d53b44
commit 91d144a
Showing
7 changed files
with
129 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<h1 align="center">Configuration</h1> | ||
|
||
# Importing | ||
|
||
```python | ||
from instagpy import config | ||
``` | ||
|
||
> ### Example - Config Usage | ||
```python | ||
from instagpy import InstaGPy | ||
from instagpy import config | ||
|
||
config.PROXY = {"http":"127.0.0.1","https":"127.0.0.1"} | ||
config.TIMEOUT = 10 | ||
|
||
insta = InstaGPy() | ||
|
||
insta.get_user_basic_details('champagnepapi',print_formatted=True) | ||
|
||
``` | ||
|
||
## Requests Limit for Sessions | ||
|
||
```python | ||
# Minimum requests to make before shuffling a session | ||
config.MIN_REQUESTS = 3 | ||
``` | ||
|
||
```python | ||
# Maximum requests to make before shuffling a session | ||
config.MAX_REQUESTS = 6 | ||
``` | ||
|
||
## Retries Limit | ||
|
||
```python | ||
# Maximun number of retries for each request | ||
config.MAX_RETRIES = 3 | ||
``` | ||
|
||
## Request Timeout | ||
|
||
```python | ||
# request timeout - in seconds | ||
config.TIMEOUT = 5 | ||
``` | ||
|
||
## Using Proxies | ||
|
||
```python | ||
# Example {"http":"proxy_here","https":"proxy_here"} Accepts python dictionary. | ||
config.PROXY = None | ||
``` | ||
|
||
## Saved Sessions Directory | ||
|
||
```python | ||
# Directory to save and load logged in sessions/cookies | ||
config.SESSION_DIRECTORY = "Insta Saved Sessions" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters