SHARE
TWEET

Untitled

a guest Feb 21st, 2020 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import hypixel
  2. import time
  3. import re
  4. choice = input('nicknames или log:pass? (1, 2): ')
  5. API_KEYS = ['2c06713d-a617-41a3-b598-e0c608e0d6da']
  6. hypixel.setKeys(API_KEYS)
  7.  
  8. l = -1
  9.  
  10. f = open('nicknames.txt', 'r')
  11. f1 = open('sorted.txt', 'w', encoding='utf-8')
  12. f2 = open('logdatabase.txt', 'r')
  13. lines = f.readlines()
  14. def login_treatment(login2):
  15.     try:
  16.         Player = hypixel.Player(login2)
  17.         PlayerName = Player.getName()
  18.         PlayerRank = Player.getRank()['rank']
  19.         PlayerLevel = str(Player.getLevel()).split('.')[0]
  20.         f1.write('=================')
  21.         f1.write('\n')
  22.         f1.write(f'nickname - {PlayerName}')
  23.         f1.write('\n')
  24.         f1.write(f'Rank - {PlayerRank}')
  25.         f1.write('\n')
  26.         f1.write(f'Level - {PlayerLevel}')
  27.         f1.write('\n')
  28.         f1.write('=================')
  29.     except hypixel.PlayerNotFoundException:
  30.         print('хуяк,акка нет в базе)')
  31.     except hypixel.HypixelAPIError:
  32.         print('Жду 30 сек и продолжаю)')
  33.         time.sleep(30)
  34. print(choice)
  35. if choice == '1':
  36.     for i in  f:
  37.         l += 1
  38.         login_treatment(lines[l].replace('\n', ''))
  39. elif choice == '2':
  40.     for j in f2:
  41.         login = re.findall('^(.+?):', j)
  42.         print(login)
  43.         Player = hypixel.Player(login[0])
  44.         login_treatment(login[0])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top