Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Proper way to handle checkpoints on instagrapi-rest #30

Open
Stiveknx opened this issue Feb 10, 2022 · 3 comments
Open

Proper way to handle checkpoints on instagrapi-rest #30

Stiveknx opened this issue Feb 10, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Stiveknx
Copy link
Contributor

While using instagrapi-rest, is useless to use the default behavior for instagrapi, to ask the SMS / E-mail code on input (STDIN).
https://github.com/adw0rd/instagrapi/blob/092b19713f920e13641c45899be5f3afab827cf4/instagrapi/mixins/private.py#L33

Since we run on an server, which is probably runing on a background task, there's no interaction with it.

A simple fork would be just setting a new challenge_code_handler
Stiveknx@90a2b23#diff-edcfd80d7c5e51c05a01f8fc4079088fe44e05a58382b801009203aca3c8ff3dR27

But, it should be possible to "resume" the previous one challenge.
The "resume", would just send a post to challenge url with the code.
It could be an endpoint, like this one:
Stiveknx@90a2b23#diff-edcfd80d7c5e51c05a01f8fc4079088fe44e05a58382b801009203aca3c8ff3dR65

But, I didn't find out, how to resume an Checkpoint, or specifically, how to "save" previous checkpoint data and resume it after.

Any clues?

@Stiveknx Stiveknx added the enhancement New feature or request label Feb 10, 2022
@Jmallone
Copy link
Contributor

Hi @Stiveknx i have the same problem

I made a twitter post asking for help, in which I summarized the main problem and the main answer was to perform a pooling
the post: https://twitter.com/jmallone2/status/1496613584385810439

but I'm thinking to create a thread when I call this /auth/# and return for frontend my PID thread and the msg for handle and the user type a code and in another endpoint this verification code is sending
e.g "POST /verify-email/PID_THREAD/VERIFICATION_CODE_HERE"

and this another endpoint catch de PID_THREAD and put the VERIFICATION_CODE in thread stdin directly

reach me if you will want talk more 👍

@Stiveknx
Copy link
Contributor Author

Called you on WhatsApp.

I believe we have an better way to handle it, I've been working here, the solution is almost done, just require some more tests.

@Jmallone
Copy link
Contributor

Jmallone commented Mar 16, 2022

A palliative solution for this issue:

instagrapi-rest:
Jmallone@7d191de

instagrapi:
Jmallone/instagrapi-1@827750d
Jmallone/instagrapi-1@54712c5
Jmallone/instagrapi-1@cdef5f1

github_edited.mp4

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants