$ show ohld/igbot
Instabot is a Python library and CLI tool for automating Instagram actions such as liking, commenting, following, unfollowing, uploading photos/videos, and direct messaging. It operates by reverse-engineering Instagram's private API, simulating an Android client with device fingerprints, session cookies, and request signing. The architecture consists of a low-level API wrapper (`instabot.api.API`) that handles HTTP requests and login flow, and a high-level Bot class (`instabot.bot.Bot`) that orchestrates actions with built-in rate limiting, filtering, and checkpointing. The repository includes over 30 example scripts for common automation tasks, a multi-script CLI menu, and a scheduled 24/7 bot. External dependencies include `requests`, `Pillow`, `moviepy`, and `pycryptodome`. The project is no longer actively maintained and carries high risk of Instagram account bans due to ToS violations. The README now promotes paid private API services, indicating the open-source codebase is effectively deprecated.
The LLM identified 4 files worth highlighting for reuse:
Implements a thread-safe Singleton metaclass. Used by BotCache and BotState to ensure a single shared instance across the application. The pattern is clean, minimal, and can be extracted into any Python project requiring a singleton.
Provides a `file` class that wraps common file operations (append, remove, random line selection, save list) with logging. It is self-contained, parameterized, and solves the recurring problem of managing plaintext configuration and state files. Easily reusable in any project that needs simple file-based persistence.
Implements save/load of bot state (counters, blocked actions, request counts) using pickle serialization. The module is isolated, with clear methods for checkpointing and restoring. This pattern is reusable in any long-running automation or batch process that needs to resume after interruption.
Provides a time-to-live (TTL) cache for user info, usernames, and follow relationships. Uses a dictionary with expiration timestamps and a cleanup method. The implementation is self-contained and demonstrates a simple but effective caching strategy that can be extracted for any application needing short-lived data caching.