Git Product home page Git Product logo

Comments (6)

adw0rd avatar adw0rd commented on May 23, 2024

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.

adw0rd avatar adw0rd commented on May 23, 2024

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.

adw0rd avatar adw0rd commented on May 23, 2024

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.

Soneji avatar Soneji commented on May 23, 2024

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.

adw0rd avatar adw0rd commented on May 23, 2024

@Soneji yes, thanks!

from instagrapi-rest.

Soneji avatar Soneji commented on May 23, 2024

fab stuff, thanks :)

from instagrapi-rest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.