Comments (6)
We already store the session (https://github.com/adw0rd/instagrapi-rest/blob/main/storages.py#L6), but it is assumed that this api is used for multiple accounts, in order to have access to several accounts at once, their identifier must be transmitted (now this is the sessionid, since it is most convenient to work with it)
from instagrapi-rest.
The benefit of something like this is that I don't have to worry about storing any session id, which could change/become invalid at any time, within my application. I just need to store my IG user/pass, which can be used if and when the session id becomes invalid.
I feel like this could be quite easily achieved using the library "load_settings" and "dump_settings" and stored in a particular location, such as /etc/instagrapi-rest/user1.json, user2.json...
You do not need to do load/dump, everything is already provided inside this service
from instagrapi-rest.
Then for Docker users (like myself), we can map that folder to a volume, ensuring that the state is maintained across container restarts. This also provides the benefit that the "device" info is maintained across container restarts too, so "Instagram can trust you more".
Yes, I agree, sessions are now stored in memory. After restarting the container, you will lose them and you will need to log in again. When saving to a store, I suggest doing a dump into a shared volume and reading it at startup (load_settings). Can you do it?
from instagrapi-rest.
Yeah I have been playing around with this just today, and I just concluded they are stored in memory. I can try make a PR for this to update storages.py to use a file instead of in memory, is that what you think is best?
from instagrapi-rest.
@Soneji yes, thanks!
from instagrapi-rest.
fab stuff, thanks :)
from instagrapi-rest.
Related Issues (20)
- [BUG] HOT 1
- [BUG] Auth login error
- [BUG] Don't build in docker
- Proper way to handle checkpoints on instagrapi-rest HOT 3
- [BUG] Getting 'Unprocessable Entity'
- [BUG] Download by url
- feedback_required HOT 4
- add method HOT 1
- Hashtag media recent like in python?
- [BUG] HOT 1
- [BUG] Invalid parameters HOT 1
- set proxy to all api HOT 3
- Session not found (e.g. after reload process), please relogin HOT 4
- [BUG] Adding mentions returns 422 HOT 1
- Share session id across devices HOT 1
- [BUG] status code 500 while trying to login HOT 6
- How to get "register date" of account? HOT 4
- About requests to the rest api HOT 1
- How can i get sessionId after login HOT 1
- Pagination of /media/user_medias HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instagrapi-rest.