-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea: change the API so that it remembers the session id, we don't have to provide it each time #10
Comments
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) |
You do not need to do load/dump, everything is already provided inside this service |
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? |
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? |
@Soneji yes, thanks! |
fab stuff, thanks :) |
Hi
I am trying to make an app using this incredible tool, however I feel some of the logic could be streamlined if the internal state of the REST API allowed for saving the session id, or at least having a mode for this. I would like to be able to:
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...
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".
The text was updated successfully, but these errors were encountered: