InstagramTheftyScraperPosterHuman is an advanced tool for automating the process of scraping, uploading, and managing Instagram reels. This tool builds upon previous versions, introducing several enhancements and new functionalities to improve automation, human-like interactions, and bot detection prevention.
InstagramTheftyScraperPosterHuman is an advanced tool for automating the process of scraping, uploading, and managing Instagram reels. This tool builds upon previous versions, introducing several enhancements and new functionalities to improve automation, human-like interactions, and bot detection prevention.
Key Differences and Enhancements
auth.py:
Logging Enhancements: Uses rich.console.Console for more detailed logging.
Session Handling: Improved session management with save_session, load_session, and update_session_file functions.
Time Zone Setting: Sets CST (Chicago) time zone during login.
Enhanced Re-login: Adds relogin function for better session handling.
Modular Code: More modular with separate functions for session handling.
Session Injection: Utilizes inject_sessionid_to_public to ensure public session usage.
main.py:
Configuration Validation: Ensures required keys in the scraping section.
Session Management: Improved with perform_login, update_session_file, and relogin functions.
Rate Limit Handling: Adds handle_rate_limit function with retries and exponential backoff.
Delay Range: Sets a delay range for human-like behavior.
Proxy Support: Adds support for proxies (not yet tested).
Default Descriptions and Comments: Moves default descriptions and comments to separate files for easier management.
Error Handling: More robust error handling with detailed logging.
utils.py:
Enhanced Logging: Improved logging messages for better clarity.
Session Management: Ensures better handling of session files.
Functionality Additions: Minor updates to align with other enhanced functionalities.
scrape.py:
Human-Like Actions: Randomly selects actions from a list of lambda functions.
Media Handling: Simplifies the process by performing actions directly on media.
Logging Enhancements: Improved logging messages.
Scraping Logic: Uses profile_reel_id for uniqueness.
Default Comments: Comments moved to a separate file for easier management.
Error Handling: More detailed logging for exceptions.
upload.py:
Default Descriptions: Descriptions moved to a separate file for easier management.
Human-Like Actions: More seamlessly integrated with improved logging.
Description Building: Enhanced with additional branding messages.
Dashboard Display: Displays the dashboard after each upload.
Resource Management: Improved logging for resource management.
Loop Logic: Maintains the waiting period logic with random sleep intervals.
Features
Core Features
Scraping Reels: Scrapes reels from specified Instagram profiles.
Uploading Reels: Uploads scraped reels with customizable descriptions and hashtags.
Human-like Actions: Performs random actions like liking, commenting, and following to mimic human behavior.
Dashboard: Displays detailed information about activities.
Anti-Bot Detection: Implements random waits and actions to avoid detection.
Logging: Logs all activities for better traceability and debugging.
Configurable Settings: Uses a YAML configuration file for easy customization.
New Features in InstagramTheftyScraperPosterHuman V3.0
Enhanced Random Waits: Added random waits between scraping, liking, commenting, and uploading actions to better simulate human behavior and reduce the risk of detection by Instagram.
Logging of Random Waits: Logged random wait times into a separate file (random-waits.json) for better tracking and debugging.
Detailed Logging of Comments: The program now logs the actual comments posted on each reel for better traceability.
Improved Error Handling: Enhanced error handling and logging to capture JSONDecodeError and other exceptions, making the script more robust.
Improved Dashboard: Updated dashboard to display detailed information about scraping, uploading, and random wait times, as well as the next file to be uploaded.
Human-like Interactions: Performs random human-like actions during waiting periods, including liking and commenting on random posts from popular hashtags.
Auto Restart Scraping: Automatically initiates the scraping process when there are no more videos left to upload in the downloads directory.
Proxy Support: Users can now configure a proxy to route Instagram requests (not yet tested).
Default Descriptions and Comments: Users can now input their default descriptions and comments during setup for easier management.
Requirements
Python 3.6+
Required Python packages (specified in requirements.txt)
Install Required Packages
You can install all the required packages using the following command:
pip install -r requirements.txt
Installation
Clone the repository:
git clone https://github.com/sujay1599/InstagramTheftyScraperPosterHuman.git
cd InstagramTheftyScraperPosterHuman
Install the required packages using requirements.txt:
pip install -r requirements.txt
Run config_setup.py to create the config.yaml file:
python config_setup.py
Follow the prompts to enter your configuration details. This will generate a config.yaml file with the necessary settings, including encrypted Instagram credentials, proxy settings, default descriptions, and comments.
Configuration
The config.yaml file will be generated by running config_setup.py. It includes the following settings:
Instagram Credentials: Provide your Instagram username and password. These will be encrypted and stored securely.
Scraping Settings:
enabled: Set to true to enable scraping.
profiles: Space-separated list of Instagram profiles to scrape reels from.
num_reels: Number of reels to scrape per profile.
scrape_interval_minutes: Interval in minutes between scraping sessions.
**Uploading
Settings**:
enabled: Set to true to enable uploading.
upload_interval_minutes: Interval in minutes between uploads.
add_to_story: Set to true to add reels to your Instagram story.
Description Settings:
use_original: Set to true to use the original reel description. If false, custom descriptions will be used.
custom_descriptions: List of custom descriptions to use if use_original is false.
Hashtags Settings:
use_hashtags: Set to true to use hashtags in the reel descriptions.
hashtags_list: List of hashtags to include in the reel descriptions (if use_hashtags is true).
Credit Settings:
give_credit: Set to true to give credit to the original poster in the reel descriptions.
Deleting Settings:
delete_interval_minutes: Interval in minutes between deletions.
Comments:
leave_comment: Set to true to leave comments on scraped videos.
comments: List of comments to leave if leave_comment is true.
Custom Tags: List of custom tags for human-like actions.
Proxy: Optional proxy settings.
Default Descriptions and Comments
The default descriptions and comments are used when the use_original option is set to false for descriptions and leave_comment is set to true. During the configuration setup, users can input their own default descriptions and comments. These defaults will be used during the uploading and commenting processes, providing more flexibility and personalization for the user.
Usage
Run the script:
python main.py
This will start the process of scraping, uploading, and performing human-like actions as configured in the config.yaml file.
Detailed Breakdown of Files
auth.py
Handles Instagram authentication and session management:
Decryption of Credentials:
Decrypts stored Instagram credentials using a generated key.
Login Management:
Manages login sessions, checking for an active session first and creating a new one if necessary.
Uses instagrapi to handle the authentication process.
Injects session IDs to the public session to maintain consistency.
config_setup.py
Generates the config.yaml configuration file with encrypted credentials. Also deletes any old status and log files to ensure a clean start.
Generating Key:
Uses cryptography.fernet.Fernet to generate an encryption key.
Encrypting Credentials:
Encrypts the Instagram username and password using the generated key.
Getting User Inputs:
Prompts the user for various configuration details such as profiles to scrape, number of reels, intervals, proxy settings, default descriptions, and default comments.
Creating and Saving Configuration:
Creates a YAML configuration file with all the provided details and encrypted credentials.
Deleting Old Files:
Deletes old status and log files to ensure a clean setup.
dashboard.py
Displays a detailed dashboard of activities, showing the status of scraping, uploading, and human-like actions.
Dashboard Information:
Displays the status of the last and next scrape, upload, and delete times.
Shows random wait times and other detailed logs.
input_helpers.py
Contains helper functions for getting user inputs during configuration setup.
Input Functions:
Functions to get and validate different types of user inputs, such as integers, booleans, and strings.
main.py
The main script that orchestrates the scraping, uploading, and human-like actions processes. It reads the configuration, manages the workflow, and ensures periodic actions are performed.
Configuration and Initialization:
Reads the config.yaml file to get the configuration settings.
Initializes logging and status files using utility functions from utils.py.
Authentication:
Uses auth.py to handle Instagram login. It checks for an existing session and uses it if available, otherwise, it performs a manual login and creates a new session, while keeping the UUIDs the same to reduce bot detection.
Scraping Logic:
Calls scrape.py to handle the scraping of Instagram reels.
Performs human-like actions using the perform_human_actions function, including liking and commenting on posts to reduce bot detection.
Uploading Logic:
Handles the uploading of scraped reels, including adding descriptions, hashtags, and crediting the original posters. This logic is found in upload.py.
Logging and Random Waits:
Implements random waits between actions to mimic human behavior and avoid detection.
Logs all activities for traceability and debugging purposes.
scrape.py
Handles scraping of Instagram reels and performing human-like actions:
Scraping Functionality:
Scrapes reels from specified Instagram profiles.
Implements human-like interactions such as liking and commenting on random posts from popular hashtags to mimic human behavior.
Human-like Actions:
The perform_human_actions function simulates human interactions by performing random actions during waiting periods, including liking and commenting on random posts.
upload.py
Handles the uploading of scraped reels:
Uploading Mechanism:
Uploads reels with customizable descriptions, hashtags, and credits.
Supports adding reels to Instagram stories if configured.
Default Descriptions:
Uses predefined default descriptions if custom descriptions are not provided.
Logging Uploads:
Logs the upload activities and tracks the uploaded reels.
utils.py
Contains utility functions for logging, status management, random sleeps, and managing JSON files for random wait times:
Logging and Status Management:
Functions for reading and updating status files, logging uploads, and handling random wait times.
Random Sleeps:
Implements random wait periods between actions to reduce bot detection.
Logs the random wait times to random-waits.json.
File Management:
Functions to delete old status and log files to ensure a clean setup.
Anti-Bot Detection
The program includes several features to avoid detection by Instagram:
Random Waits: Implements random waits between actions to mimic human behavior.
Human-like Actions: Performs random actions like liking, commenting, and following during the waiting periods.
Detailed Logging: Logs all activities for better traceability and debugging.
Logging
The script maintains several log files to track activities and debug issues:
upload_log.txt: Keeps track of uploaded reels.
status.json: Tracks the last action times and other status information.
random-upload-times.json: Logs the random sleep times between uploads.
random-waits.json: Logs the random wait times between various actions.
Dashboard
Run the dashboard script to view detailed information about scraping, uploading activities, and random wait times:
python dashboard.py
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
Disclaimer
This script is intended for educational and personal use only. Use it responsibly and ensure you comply with Instagram’s terms of service and guidelines.
Better than ever!### Updated README for InstagramTheftyScraperPosterHuman V3.0
InstagramTheftyScraperPosterHumanV3.0
8/5/2024
High-Level Changes
CHANGE LOG:
V3.0: Enhanced Breakdown of Changes in InstagramTheftyScraperPosterHuman V3.0 vs InstagramTheftyScraperPosterHuman V2.2
InstagramTheftyScraperPosterHuman is an advanced tool for automating the process of scraping, uploading, and managing Instagram reels. This tool builds upon previous versions, introducing several enhancements and new functionalities to improve automation, human-like interactions, and bot detection prevention.
Key Differences and Enhancements
auth.py:
rich.console.Console
for more detailed logging.save_session
,load_session
, andupdate_session_file
functions.relogin
function for better session handling.inject_sessionid_to_public
to ensure public session usage.main.py:
scraping
section.perform_login
,update_session_file
, andrelogin
functions.handle_rate_limit
function with retries and exponential backoff.utils.py:
scrape.py:
profile_reel_id
for uniqueness.upload.py:
Features
Core Features
New Features in InstagramTheftyScraperPosterHuman V3.0
random-waits.json
) for better tracking and debugging.Requirements
requirements.txt
)Install Required Packages
You can install all the required packages using the following command:
Installation
Clone the repository:
Install the required packages using
requirements.txt
:Run
config_setup.py
to create theconfig.yaml
file:Follow the prompts to enter your configuration details. This will generate a
config.yaml
file with the necessary settings, including encrypted Instagram credentials, proxy settings, default descriptions, and comments.Configuration
The
config.yaml
file will be generated by runningconfig_setup.py
. It includes the following settings:Configuration Details
enabled
: Set totrue
to enable scraping.profiles
: Space-separated list of Instagram profiles to scrape reels from.num_reels
: Number of reels to scrape per profile.scrape_interval_minutes
: Interval in minutes between scraping sessions.**Uploading
Settings**:
enabled
: Set totrue
to enable uploading.upload_interval_minutes
: Interval in minutes between uploads.add_to_story
: Set totrue
to add reels to your Instagram story.use_original
: Set totrue
to use the original reel description. Iffalse
, custom descriptions will be used.custom_descriptions
: List of custom descriptions to use ifuse_original
isfalse
.use_hashtags
: Set totrue
to use hashtags in the reel descriptions.hashtags_list
: List of hashtags to include in the reel descriptions (ifuse_hashtags
istrue
).give_credit
: Set totrue
to give credit to the original poster in the reel descriptions.delete_interval_minutes
: Interval in minutes between deletions.leave_comment
: Set totrue
to leave comments on scraped videos.comments
: List of comments to leave ifleave_comment
istrue
.Default Descriptions and Comments
The default descriptions and comments are used when the
use_original
option is set tofalse
for descriptions andleave_comment
is set totrue
. During the configuration setup, users can input their own default descriptions and comments. These defaults will be used during the uploading and commenting processes, providing more flexibility and personalization for the user.Usage
Run the script:
This will start the process of scraping, uploading, and performing human-like actions as configured in the
config.yaml
file.Detailed Breakdown of Files
auth.py
Handles Instagram authentication and session management:
Decryption of Credentials:
Login Management:
instagrapi
to handle the authentication process.config_setup.py
Generates the
config.yaml
configuration file with encrypted credentials. Also deletes any old status and log files to ensure a clean start.Generating Key:
cryptography.fernet.Fernet
to generate an encryption key.Encrypting Credentials:
Getting User Inputs:
Creating and Saving Configuration:
Deleting Old Files:
dashboard.py
Displays a detailed dashboard of activities, showing the status of scraping, uploading, and human-like actions.
input_helpers.py
Contains helper functions for getting user inputs during configuration setup.
main.py
The main script that orchestrates the scraping, uploading, and human-like actions processes. It reads the configuration, manages the workflow, and ensures periodic actions are performed.
Configuration and Initialization:
config.yaml
file to get the configuration settings.utils.py
.Authentication:
auth.py
to handle Instagram login. It checks for an existing session and uses it if available, otherwise, it performs a manual login and creates a new session, while keeping the UUIDs the same to reduce bot detection.Scraping Logic:
scrape.py
to handle the scraping of Instagram reels.perform_human_actions
function, including liking and commenting on posts to reduce bot detection.Uploading Logic:
upload.py
.Logging and Random Waits:
scrape.py
Handles scraping of Instagram reels and performing human-like actions:
Scraping Functionality:
Human-like Actions:
perform_human_actions
function simulates human interactions by performing random actions during waiting periods, including liking and commenting on random posts.upload.py
Handles the uploading of scraped reels:
Uploading Mechanism:
Default Descriptions:
Logging Uploads:
utils.py
Contains utility functions for logging, status management, random sleeps, and managing JSON files for random wait times:
Logging and Status Management:
Random Sleeps:
random-waits.json
.File Management:
Anti-Bot Detection
The program includes several features to avoid detection by Instagram:
Logging
The script maintains several log files to track activities and debug issues:
Dashboard
Run the dashboard script to view detailed information about scraping, uploading activities, and random wait times:
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
Disclaimer
This script is intended for educational and personal use only. Use it responsibly and ensure you comply with Instagram’s terms of service and guidelines.