Closed haayhappen closed 4 years ago
I have not been working with this repository for a long time, I am sure there is a better solution, but I can show you something that works for me.
/*...*/
.catch(IgCheckpointError, async () => {
await ig.challenge.auto(true);
await saveCheckpoint(ig.state.checkpoint, username);
/*...*/
/*...*/
ig.state.checkpoint = await restoreCheckpoint(username);
const response = await ig.challenge.sendSecurityCode(code);
/*...*/
async function saveCheckpoint(data: object, username) {
const checkpointStatePath = `${process.env.IG_CHECKPOINT_PATH}/${username}.json`;
await writeFile(checkpointStatePath, JSON.stringify(data), {flag: 'w'}, (e) => {
if (e) throw e;
});
}
async function restoreCheckpoint(username) {
const checkpointStatePath = `${process.env.IG_CHECKPOINT_PATH}/${username}.json`;
if (await existsSync(userCheckpointState)) {
const data: string = await Bluebird.fromCallback(cb => readFile(checkpointStatePath, 'utf8', cb));
return JSON.parse(data);
}
}
call the function below.
https://github.com/dilame/instagram-private-api/blob/master/examples/checkpoint.example.ts
call the function below.
https://github.com/dilame/instagram-private-api/blob/master/examples/checkpoint.example.ts
Hi, this function requires the user to enter the Security Code manually. There is no way to access the cli of a running lambda function, so I need a way to get the code and delay lambda execution until that code is available and the run the function again.
You cant trick Instagram's manual verification process. There are multi layer manual operations like "SMS code", "This was me"(on device/browser that you logged in before) screen. Because Lambda functions are invoking themselves from different regions than your actual region. Instagram will force you to do than on each lambda invocation. And i think you already know that. ^_^
My Suggestion is:
PS: If you have a plan with different accounts in different IPs/Lambdas, Instagram has very strict bot detection mechanism so this plan isn't sustainable.
General Question
Form
Put an
[x]
if you meet the condition, else leave[ ]
.Question
Hi there, I'm using this lib in a Serverless Microservice. Does anyone have an idea to solve the challenge when running in a lambda with no possibility for user interaction to enter the code?
Thanks.