Advertisement
Guest User

Untitled

a guest
May 21st, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #Import the modules
  2. import json
  3. import requests
  4. import time
  5.  
  6. # Read The SteamID File and write to variables
  7. text_file = open("id.txt", "r")
  8. lines = text_file.read().split('\n')
  9. text_file.close()
  10. counter = 0
  11. while (counter < len(lines)):
  12. # Get the feed
  13. r = requests.get("https://api.roleplay.co.uk/v1/player/" + lines[counter] + "/minimal")
  14. r.text
  15.  
  16. #If 404 Error print Steam ID Not Found
  17. if r.status_code == 404:
  18. print("Invalid Steam ID")
  19. counter =counter +1
  20. elif r.status_code == 429:
  21. time.sleep(360)
  22. else:
  23. # Convert it to a Python dictionary
  24. data = json.loads(r.text)
  25.  
  26. #Print The UID
  27. print(data['uid'])
  28. counter =counter +1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement