Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. # Imagetyperz captcha API test
  2. # ------------------------------
  3. from imagetypersapi import ImageTypersAPI
  4. from time import sleep
  5.  
  6. # solve captcha
  7. def test_api():
  8. username = ''
  9. password = ''
  10.  
  11. ita = ImageTypersAPI(username, password) # init imagetyperz api obj
  12.  
  13. # check account balance
  14. # ---------------------------
  15. balance = ita.account_balance() # get account balance
  16. print 'Balance: {}'.format(balance) # print balance
  17.  
  18. # solve normal captcha
  19. print 'Waiting for captcha to be solved ...'
  20. # -----------------------------------------------------------------------------------------------
  21. captcha_text = ita.solve_captcha('captcha.jpg', case_sensitive = True) # solve captcha, with case sensitive arg True
  22. print 'Captcha text: {}'.format(captcha_text) # print captcha solved text
  23. # -----------------------------------------------------------------------------------------------
  24.  
  25.  
  26. # main method
  27. def main():
  28. try:
  29. test_api() # test captcha API
  30. except Exception, ex:
  31. print '[!] Error occured: {}'.format(ex)
  32.  
  33. if __name__ == "__main__":
  34. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement