Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.py #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snootysteppes
Copy link

Concurrency Improvements:

  • Multithreading: Accounts are processed concurrently using threading.Thread, speeding up the script by handling multiple accounts at once.
  • Thread Delay: Introduced time.sleep(0.5) between thread starts to avoid overwhelming the server.

Logging Enhancements:

  • Thread-Safe Logging: Implemented log_safe() using a threading.Lock to ensure logs from different threads do not overlap, ensuring clear and consistent log output.
  • Improved Log Messages: Made the logging more informative and easier to read, including relevant details like proxy usage and account balances.

Error Handling & Resilience:

  • Graceful Shutdown: Properly handle KeyboardInterrupt so that the program can be safely stopped by the user.
  • Enhanced Error Logging: Added more robust logging of exceptions and network errors to the log file (last.log), allowing better diagnosis when issues arise.

Proxy Handling Improvements:

  • Modular Proxy Handling: Moved proxy logic into a new function handle_proxy(), improving readability and simplifying proxy management and rotation.

Token Management:

  • Cleaner Token Insertion: Used setdefault in save_tokens() for cleaner, more concise handling of token storage.
  • Modular Token Loading: The process_account() function now handles each account’s token separately, improving modularity.

Separation of Concerns:

  • Modularized Functions: Broke down responsibilities like token management, proxy handling, and processing each account into individual functions for better code organization and easier maintenance.

Other General Improvements:

  • Delay Between Processing Accounts: Added a countdown timer between account processing (countdown_timer(config["delay_account"])) to respect potential API rate limits or server loads.
  • Graceful Thread Join: Ensured all threads are joined at the end of the process, waiting for each to finish before moving forward to maintain process integrity.

This changes make the code more efficient, easier to maintain, and more resilient to errors. If you find this good sir please add.

@Nord1cWarr1or
Copy link

Nice

@hthodev
Copy link

hthodev commented Nov 24, 2024

You can edit the requirements file, download the packages that the code needs.

requests
colorama
fake_useragent
cloudscraper
pycryptodome instead of Crypto
cloudscraper
colorama

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants