
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
instauto2 is an Instagram automation/bot library written in modern, clean javascript using Google's Puppeteer-core. Goal is to be very easy to set up, use, and extend, and obey instagram's limits. Heavily inspired by InstaPy.
Also, this library is a huge upgrade from instauto
First install Node.js.
Create a new directory with a file like example.js or example-loki.js
Adjust your example.js to your needs. If you want to see how it would work without doing any invasive actions, use the dryRun: true option. Toggle headless to see it in action.
Open a terminal in the directory
Run npm i
Run npm i puppeteer-core instauto2
Run node example
You can run this code for example once every day using cron or pm2 or similar
Follow the followers of some particular users. (e.g. celebrities.) Parameters like max/min ratio for followers/following can be set.
Unfollow users that don't follow us back. Will not unfollow any users that we recently followed.
Unfollow auto followed users (also those following us back) after a certain number of days.
The code automatically prevents breaching 100 follow/unfollows per hour or 700 per 24hr, to prevent bans. This can be configured.
See example.js or example-loki.js for example of features
The data are stored in json files by default using the file-db.adapter internally.
If you need to override the default behavior you can either choose to use the other adapter provided which is using
lokijs or you could create your own adapter to pass to instauto.
To create your own adapter you can have a look to loki-db.adapter.ts. Basically you need to create a class that extend the AbstractDbAdapter such as :
export class MyAdapter extends AbstractDbAdapter {
constructor(private readonly instance: YourInstanceType, private readonly logger: LiteLogger) {
super();
}
addLikedPhoto({ username, href, time }: LikedPhoto): Promise<void> {
// ... You code goes here ...
}
addPrevFollowedUser(follower: Follower): Promise<void> {
// ... You code goes here ...
}
addPrevUnfollowedUser(unfollower: UnFollower): Promise<void> {
// ... You code goes here ...
}
getFollowedLastTimeUnit(timeUnit: number): Promise<Follower[]> {
// ... You code goes here ...
}
getLikedPhotosLastTimeUnit(timeUnit: number): Promise<LikedPhoto[]> {
// ... You code goes here ...
}
getPrevFollowedUser(username: string): Promise<Follower> {
// ... You code goes here ...
}
getUnfollowedLastTimeUnit(timeUnit: number): Promise<UnFollower[]> {
// ... You code goes here ...
}
}
To see how to use you own adapter you can have a look to the example-loki.js
The library support multiple language for logging purpose.
The default language is english but you can switch to french or provide your own language.
to change to language using the provided translation see the following example
languageManager.useExistingCustomLanguage('fr');
// or
languageManager.useExistingCustomLanguage('en');
to be able to provide your own translations use the following example
languageManager.setCustomLanguage({
// The translations goes here
});
Finally, to reset the language to the original one (en), use the following example
languageManager.resetLanguage();
See also:
Also you might want to install the more lightweight package puppeteer-core instead of puppeteer.
Made with ❤️ in 🇫🇷
FAQs
Instagram automation library written for Node.js
We found that instauto2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.