const IgApiClient = require('instagram-private-api').IgApiClient;
const fs = require('fs');
const config = require('./config.json');
const ig = new IgApiClient();
ig.state.generateDevice(config.instagramUsername);
ig.state.proxyUrl = config.igProxy;
async function uploadImage(imageBuffer) {
const imageUrl = await ig.upload.photo(
{
file: imageBuffer
}
);
console.log(`URL: ${imageUrl}`);
}
(async () => {
await ig.simulate.preLoginFlow();
const loggedInUser = await ig.account.login(config.instagramUsername, config.instagramPassword);
process.nextTick(async () => await ig.simulate.postLoginFlow());
const imageBuffer = fs.readFileSync('output.png');
uploadImage(imageBuffer);
})();
错误:
C:\Users\PC\Desktop\spotted ode_modules\instagram-private-api\dis