mifi / instauto

Instagram bot / automation library written in Javascript for Node.js
799 stars 145 forks source link

Cannot run getFollowersOrFollowing #97

Open listinfm opened 2 years ago

listinfm commented 2 years ago

In trying to run: const myfollowers = await instauto.getFollowersOrFollowing({userId: 'username', getFollowers: true});

I get the following error: TypeError: Cannot read properties of null (reading 'edge_follow') at processTicksAndRejections (node:internal/process/task_queues:96:5)

if getFollowers is set to false, then I get the following error: TypeError: Cannot read properties of null (reading 'edge_followed_by') at processTicksAndRejections (node:internal/process/task_queues:96:5)

This is the function that is getting called: function getFollowersOrFollowingGenerator({ userId, getFollowers = false }) { const edge_follow = 100 return graphqlQueryUsers({ getResponseProp: (json) => json.data.user[getFollowers ? 'edge_followed_by' : 'edge_follow'], graphqlVariables: { id: userId }, queryHash: getFollowers ? '37479f2b8209594dde7facb0d904896a' : '58712303d941c6855d4e888c5f0cd22f', }); }

not sure what should edge_followed_by or edge_follow should be or how to not make them null..

npm version: 8.10.0 node version: v16.15.0 OS: Ubuntu 18.0

mifi commented 2 years ago

I don't think it means that edge_followed_by is null, but rather json.data.user is null. I'm not sure why it would be null, but it would indicate some data missing from instagram. If you could record a snapshot of the content of the page when it happened, then it might help to figure out what's causing it