{"id":15697976,"url":"https://github.com/adrien2p/instauto2","last_synced_at":"2025-05-08T22:43:09.327Z","repository":{"id":42582911,"uuid":"422992011","full_name":"adrien2p/instauto2","owner":"adrien2p","description":"Instauto2 is providing typescript support, language and db adapters","archived":false,"fork":false,"pushed_at":"2023-03-06T14:38:51.000Z","size":340,"stargazers_count":7,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-08T22:43:00.934Z","etag":null,"topics":["automation","bot","bot-library","follow","instagram","instagram-auto-follow","instagram-automation","unfollow"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adrien2p.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-30T21:14:10.000Z","updated_at":"2024-11-21T11:24:25.000Z","dependencies_parsed_at":"2024-10-24T02:57:11.223Z","dependency_job_id":"f8919821-b008-493e-bbfa-d9a47a0079c5","html_url":"https://github.com/adrien2p/instauto2","commit_stats":{"total_commits":51,"total_committers":1,"mean_commits":51.0,"dds":0.0,"last_synced_commit":"737c53de04fb97805a42a9159c27ce892dc0bca8"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien2p%2Finstauto2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien2p%2Finstauto2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien2p%2Finstauto2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien2p%2Finstauto2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrien2p","download_url":"https://codeload.github.com/adrien2p/instauto2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253160727,"owners_count":21863624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","bot","bot-library","follow","instagram","instagram-auto-follow","instagram-automation","unfollow"],"created_at":"2024-10-03T19:22:26.977Z","updated_at":"2025-05-08T22:43:09.306Z","avatar_url":"https://github.com/adrien2p.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Npm package version](https://badgen.net/npm/v/instauto2)](https://npmjs.com/package/instauto2)\n[![Npm package daily downloads](https://badgen.net/npm/dd/instauto2)](https://npmjs.com/package/instauto2)\n[![Npm package monthly downloads](https://badgen.net/npm/dm/instauto2)](https://npmjs.com/package/instauto2)\n[![Npm package monthly downloads](https://badgen.net/npm/dy/instauto2)](https://npmjs.com/package/instauto2)\n[![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/adrien2p/instauto2/blob/main/LICENCE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"641\" height=\"421\" src=\".github/logo/logo.png\"\u003e\n\u003c/p\u003e\n\ninstauto2 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](https://github.com/timgrossmann/InstaPy).\n\nAlso, this library is a huge upgrade from [instauto](https://github.com/mifi/instauto)\n\n## Setup\n\n- First install [Node.js](https://nodejs.org/en/).\n\n- Create a new directory with a file like [example.js](https://github.com/adrien2p/instauto2/blob/main/example.js)\n or [example-loki.js](https://github.com/adrien2p/instauto2/blob/main/example-loki.js)\n\n- 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.\n\n- Open a terminal in the directory\n\n- Run `npm i`\n\n- Run `npm i puppeteer-core instauto2`\n\n- Run `node example`\n\nYou can run this code for example once every day using cron or pm2 or similar\n\n## Supported functionality\n\n- Follow the followers of some particular users. (e.g. celebrities.) Parameters like max/min ratio for followers/following can be set.\n\n- Unfollow users that don't follow us back. Will not unfollow any users that we recently followed.\n\n- Unfollow auto followed users (also those following us back) after a certain number of days.\n\n- The code automatically prevents breaching 100 follow/unfollows per hour or 700 per 24hr, to prevent bans. This can be configured.\n\nSee [example.js](https://github.com/adrien2p/instauto2/blob/main/example.js) or [example-loki.js](https://github.com/adrien2p/instauto2/blob/main/example-loki.js) for example of features\n\n## Data management\n\nThe data are stored in json files by default using the `file-db.adapter` internally.\nIf you need to override the default behavior you can either choose to use the other adapter provided which is using \n[lokijs](https://github.com/techfort/LokiJS) or you could create your own adapter to pass to `instauto`.\n\n### Creating your own adapter\n\nTo create your own adapter you can have a look to [loki-db.adapter.ts](https://github.com/adrien2p/instauto2/blob/main/src/core/db_adapters/loki-db.adapter.ts).\nBasically you need to create a class that extend the [AbstractDbAdapter](https://github.com/adrien2p/instauto2/blob/main/src/core/db_adapters/abstract-db.adapter.ts) \nsuch as :\n\n```typescript\nexport class MyAdapter extends AbstractDbAdapter {\n  constructor(private readonly instance: YourInstanceType, private readonly logger: LiteLogger) {\n    super();\n  }\n\n  addLikedPhoto({ username, href, time }: LikedPhoto): Promise\u003cvoid\u003e {\n    // ... You code goes here ...\n  }\n\n  addPrevFollowedUser(follower: Follower): Promise\u003cvoid\u003e {\n    // ... You code goes here ...  \n  }\n\n  addPrevUnfollowedUser(unfollower: UnFollower): Promise\u003cvoid\u003e {\n    // ... You code goes here ...\n  }\n\n  getFollowedLastTimeUnit(timeUnit: number): Promise\u003cFollower[]\u003e {\n    // ... You code goes here ...\n  }\n\n  getLikedPhotosLastTimeUnit(timeUnit: number): Promise\u003cLikedPhoto[]\u003e {\n    // ... You code goes here ...\n  }\n\n  getPrevFollowedUser(username: string): Promise\u003cFollower\u003e {\n    // ... You code goes here ...\n  }\n\n  getUnfollowedLastTimeUnit(timeUnit: number): Promise\u003cUnFollower[]\u003e {\n    // ... You code goes here ...\n  }\n}\n```\n\nTo see how to use you own adapter you can have a look to the [example-loki.js](https://github.com/adrien2p/instauto2/blob/main/example-loki.js)\n\n## Language\n\nThe library support multiple language for logging purpose.\nThe default language is `english` but you can switch to `french` or provide your own language.\n\nto change to language using the provided translation see the following example\n\n```typescript\nlanguageManager.useExistingCustomLanguage('fr');\n\n// or\n\nlanguageManager.useExistingCustomLanguage('en');\n```\n\nto be able to provide your own translations use the following example\n\n```typescript\nlanguageManager.setCustomLanguage({\n    // The translations goes here\n});\n```\nFinally, to reset the language to the original one (en), use the following example\n\n```typescript\nlanguageManager.resetLanguage();\n```\n\n## Tips\n\n- Run this on a machine with a non-cloud IP to avoid being banned\n\n## Troubleshooting\n\n- If it doesn't work, make sure your instagram language is set to english\n\nSee also:\n- https://github.com/GoogleChrome/puppeteer/issues/550\n- https://github.com/GoogleChrome/puppeteer/issues/3774\n\nAlso you might want to install the more lightweight package `puppeteer-core` instead of `puppeteer`.\n\nMade with ❤️ in 🇫🇷","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrien2p%2Finstauto2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrien2p%2Finstauto2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrien2p%2Finstauto2/lists"}