Closed austinkimchi closed 2 years ago
i also having this issue, anyone can help on this?
I have spent multiple hours trying to find the issue but can't. I'm not sure what exactly is the problem but please help.
I get this error in my terminal: error - ./node_modules/instagram-web-api/lib/index.js:2:0 Module not found: Can't resolve 'fs'
Getting the same error
..\node_modules\instagram-web-api\lib\index.js:152 }).then(data => data.graphql.user) TypeError: Cannot read property 'user' of undefined
EDIT: So my solution was a stupid one. I forgot password was case-senstive so was inputting that wrong. I would recommend double-checking your log-in info and cookies.
Hello No solution for the moment?
Got the same error, login credentials are working fine. ` console.log('Credentials', process.env.INSTA_USER, process.env.INSTA_PASS);
const client = new Instagram({
username: process.env.INSTA_USER,
password: process.env.INSTA_PASS
});
let performImageFetch = true;
try {
console.log('logging in 🔒...');
await client.login();
console.log('Login successfull ✅');
} catch (err) {
performImageFetch = false;
console.log('Login failed 🚫');
if (err.status === 403) {
console.log('Throttled 🚫');
return;
}
if (err.error && err.error.message === 'checkpoint_required') {
console.log('Challenge failed!', 'Performing new challenge...');
const challengeUrl = err.error.checkpoint_url;
await client.updateChallenge({ challengeUrl, choice: 1 });
performImageFetch = true;
}
}
if (performImageFetch) {
console.log('Getting photos 📸... ');
client
.getPhotosByUsername({
username: 'scorpiomodelmanagement'
})
.then((response) => {
// console.log(response);
console.log('Images received ✅');
posts = response.user.edge_owner_to_timeline_media.edges;
})
.catch((error) => {
console.log('Failed getting images 🚫');
console.log(error);
});
} `
Fails when I try to get the images using getPhotosByUsername
. Fails on this.getUserByUsername
because user is undefined.
Same error here when using getFollowings and getUserByUsername... everything was working before a block from instagram, using the account is working fine, but with the library functions not
I could fix that by removing the cookie from auth, working fine now
I could fix that by removing the cookie from auth, working fine now
do you mind share your code here? regarding on how to remove the cookie from auth, thanks!
still no update?
The code I have been using has been working in the morning but after 2 hours of coding it seemed to stop after I tested it.
I tested with this code: `const Instagram = require('instagram-web-api') const { username, password } = process.env
const client = new Instagram({ username, password }); const instagram = await client.getUserByUsername({ username: 'instagram' }) ` Then I get the error:
I used runkit to test this out to make sure my code wasn't wrong or anything....
Please help. I don't know if this is because of Instagram API down or anything but my earlier it was working. I tried changing IP address aswell and still errored out.
.env
username=?
and password=?
npm i dotenv
const dotenv = require("dotenv"); dotenv.config();
Never figured out and tried everything but I'm using another module to power this.
@PrincessKimchi what is the module you use ?
The code I have been using has been working in the morning but after 2 hours of coding it seemed to stop after I tested it.
I tested with this code: `const Instagram = require('instagram-web-api') const { username, password } = process.env
const client = new Instagram({ username, password }); const instagram = await client.getUserByUsername({ username: 'instagram' }) ` Then I get the error:
I used runkit to test this out to make sure my code wasn't wrong or anything....
Please help. I don't know if this is because of Instagram API down or anything but my earlier it was working. I tried changing IP address aswell and still errored out.