Advertisement
ExamV1

CapSolver Balance Checker

Mar 7th, 2023
512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.48 KB | None | 0 0
  1. #This is a simple python script that allows you to check the balance of any valid 2Captcha API key.
  2. #Check out it on replit! https://replit.com/@ExamV1/CapSolver-Balance-Checker?v=1
  3.  
  4. import time
  5. import capsolver
  6. import os
  7.  
  8. while True:
  9.     capsolver.api_key = input("Enter your Capsolver API key: ")
  10.     try:
  11.         balance_response = capsolver.balance()
  12.         if balance_response is not None and 'balance' in balance_response:
  13.             balance = balance_response['balance']
  14.             break
  15.     except:
  16.         print("Incorrect API key. Please try again.")
  17.  
  18. print(f"Press Enter to refresh your balance.\n You currently have ${balance:.3f}")
  19.  
  20. while True:
  21.     command = input()
  22.     if command.lower() == "quit":
  23.         break
  24.     elif command == "":
  25.         print("Refreshing balance", end="", flush=True)
  26.         for _ in range(6):
  27.             time.sleep(0.1)
  28.             print(".", end="", flush=True)
  29.         print()
  30.         os.system("cls" if os.name == "nt" else "clear")
  31.         try:
  32.             balance_response = capsolver.balance()
  33.             if balance_response is not None and 'balance' in balance_response:
  34.                 balance = balance_response['balance']
  35.                 print(f"Your balance is: {balance:.3f}")
  36.             else:
  37.                 print("Failed to get balance.")
  38.         except:
  39.             print("Incorrect API key. Please try again.")
  40.         print("Press Enter to refresh the balance")
  41.     else:
  42.         print("Invalid command.")
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement