-
Notifications
You must be signed in to change notification settings - Fork 2
Changes V2 to V2.1
-
Logging Enhancements:
- The new version uses
rich.console.Console
for logging instead ofrich.logging.RichHandler
. This provides more flexibility and detailed logging messages.
- The new version uses
-
Session Handling:
-
Old Version: Used
client.load_settings
andclient.dump_settings
to manage sessions. -
New Version: Introduces
save_session
,load_session
, andupdate_session_file
functions for more robust session management, including handling cookies and authorization data.
-
Old Version: Used
-
Time Zone Setting:
- The new version sets the time zone offset to CST (Chicago) during login and re-login, which was not present in the old version.
-
Enhanced Re-login Functionality:
- The new version includes a
relogin
function to handle re-login scenarios, ensuring the session file is updated with the latest session information.
- The new version includes a
-
Error Handling:
- Both versions handle errors, but the new version provides more detailed error messages and prints them using
console.print
.
- Both versions handle errors, but the new version provides more detailed error messages and prints them using
-
Credential Encryption/Decryption:
- Both versions use
cryptography.fernet.Fernet
for encrypting and decrypting credentials, but the new version has addedgenerate_key
andencrypt_credentials
functions to handle encryption more explicitly.
- Both versions use
-
Code Structure:
- The new version is more modular, with separate functions for session handling and re-login, making it more maintainable and extensible.
-
Configuration Validation:
-
New Version: Adds validation to check for required keys in the
scraping
section to ensure all necessary configurations are present before running the script.
-
New Version: Adds validation to check for required keys in the
-
Session Management:
-
Old Version: Calls
login
directly and handles session reuse within thelogin
function. -
New Version: Introduces
perform_login
,update_session_file
, andrelogin
functions for better session management, including retries and exponential backoff.
-
Old Version: Calls
-
Rate Limit Handling:
-
New Version: Adds a
handle_rate_limit
function to manage rate limits and login required errors with exponential backoff and retries, enhancing the robustness of scraping and uploading operations.
-
New Version: Adds a
-
Delay Range:
- New Version: Sets a delay range for the Instagram client to mimic human behavior, which was not explicitly set in the old version.
-
Error Handling:
- New Version: Provides more robust error handling with detailed logging and retries for scraping and uploading loops, including handling specific exceptions for rate limits and login requirements.
-
Proxy Support:
- New Version: Adds support for setting a proxy if specified in the configuration, enhancing flexibility for different network environments.
-
Human-Like Actions:
- Both versions perform human-like actions randomly during scraping, uploading, and waiting periods, but the new version ensures these actions are more seamlessly integrated with enhanced error handling and retries.
-
Code Structure and Functionality:
- Both versions include functions for handling random sleeps, logging, and status file management, but the new version maintains the same overall structure and functionality with minor improvements in logging and error handling.
-
Logging Enhancements:
-
Old Version: Uses
rich.console.Console
for logging. -
New Version: Continues using
rich.console.Console
with consistent enhancements in log messages for better clarity.
-
Old Version: Uses
-
Session Management:
-
New Version: Ensures better handling of session files, including retries and error handling, although not explicitly different in
utils.py
, it's part of the overall enhancement in session management across the scripts.
-
New Version: Ensures better handling of session files, including retries and error handling, although not explicitly different in
-
Error Handling:
- Both versions handle errors, but the new version includes more detailed logging messages, ensuring that operations such as file deletions and status updates are logged with more clarity.
-
Functionality Additions:
- The functions remain largely the same, but the new version may include updates that align with other enhanced functionalities in the project, such as better handling of random wait times and upload times.
-
Initialization and Updates:
- Old Version: Initializes and updates JSON files and status files.
- New Version: Maintains the same initialization and update functions with improved logging and message clarity.
-
Human-Like Actions:
-
Old Version:
- Uses three separate calls to
hashtag_medias_recent_v1
,hashtag_medias_top_v1
, andhashtag_medias_top
to gather media for human-like actions.
- Uses three separate calls to
-
New Version:
- Introduces a list of actions with lambda functions and randomly selects one to perform, simplifying and randomizing the selection process for human-like actions.
-
Old Version:
-
Media Handling:
-
Old Version:
- Combines media lists from different sources and ensures no duplicates before performing actions.
-
New Version:
- Directly performs actions on the media returned by the randomly chosen function without combining lists, simplifying the process.
-
Old Version:
-
Logging Enhancements:
-
New Version:
- Improved logging messages to indicate the specific function used for finding media and providing more detailed messages throughout the scraping process.
-
New Version:
-
Scraping Logic:
-
Old Version:
- Checks if the reel is already in
uploaded_reels
orscraped_reels
using just the reel ID.
- Checks if the reel is already in
-
New Version:
- Constructs a
profile_reel_id
combining profile and reel ID to ensure uniqueness and checks againstuploaded_reels
andscraped_reels
using this composite ID.
- Constructs a
-
Old Version:
-
Error Handling:
- Both versions handle errors, but the new version provides more detailed logging messages when exceptions occur during scraping or human-like actions.
-
Status Updates:
-
Old Version:
- Updates status with just the reel ID.
-
New Version:
- Updates status with
profile_reel_id
to ensure the status includes unique identifiers for each scraped reel.
- Updates status with
-
Old Version:
-
Sleep Function:
- Both versions use a random sleep function to mimic human behavior, but the new version includes additional detailed logging messages for better traceability.
-
Default Descriptions:
- Old Version: Used general descriptions.
- New Version: Added branding and promotional messages for social media accounts (@bigclappin, @bigclappinmemes, @big.clap.memes) to the default descriptions.
-
Logging Enhancements:
- Both versions utilize
rich.console.Console
for logging, but the new version may provide more detailed and consistent log messages throughout the upload process.
- Both versions utilize
-
Human-Like Actions:
- Both versions perform human-like actions during wait times, but the new version ensures these actions are more seamlessly integrated with improved logging and detailed messaging.
-
Error Handling:
- Both versions handle errors, but the new version provides more detailed error messages and improved logging for exceptions during reel uploads and video resource releases.
-
Description Building:
- Old Version: Builds descriptions from a list of default descriptions, original descriptions, or custom descriptions based on configuration.
- New Version: Enhances description building with additional branding messages.
-
Dashboard Display:
- Both versions call the dashboard display function after each upload and story upload to provide real-time updates.
-
Wait Times:
- Old Version: Sets a wait time of 60 to 180 seconds before uploading to the story.
- New Version: Maintains similar wait times but includes additional random sleep intervals and detailed logging for better traceability.
-
Resource Management:
- Both versions release video resources after uploads, but the new version may include more detailed logging for resource management.
-
Loop Logic:
- Both versions include logic to handle the waiting period between uploads, with random sleep intervals and potential human-like actions during these periods.
-
Minor Adjustments:
- New Version: May include minor adjustments in logging, error handling, and sleep intervals to improve the overall robustness and maintainability of the script.
These key differences and enhancements make the new version of the InstagramTheftyScraperPosterHuman
project more robust, user-friendly, and maintainable. The improvements in logging, session management, error handling, and integration of human-like actions ensure a smoother and more reliable automation process.