Guest User

Enjoi

a guest
Jun 29th, 2020
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.37 KB | None | 0 0
  1. import requests
  2. import sys
  3. import os
  4. import json
  5. import string
  6.  
  7.  
  8. GamePassID = input('GamePass ID: ')
  9. IDs = 'Usernames.txt'
  10. Output = open('ConfirmedOwners.txt', 'a')
  11.  
  12.  
  13.  
  14. with open(IDs) as fp:
  15.     for cnt, line in enumerate(fp):
  16.         r = requests.get('https://api.roblox.com/users/get-by-username', params={'username':line.strip()})
  17.         user_id = r.json()['Id']
  18.         usrid = str(user_id)
  19.         url = 'https://inventory.roblox.com/v1/users/' + usrid.strip() + '/items/GamePass/' + GamePassID
  20.        
  21.         r = requests.get(url)
  22.         if "GamePass" in str(r.json()):
  23.             print('User: ' + line.strip() + " | Has The GamePass!!!")
  24.             Output.write('User: ' + line.strip() + ' | Has The GamePass!!!\n')
  25.             durl = "DISCORDWEBHOOKHERE"
  26.             data = {}
  27.             data["content"] = 'User: ' + line.strip() + " | Has The GamePass!!!"
  28.             data["username"] = "Enjoi Deliveries"
  29.             result = requests.post(durl, data=json.dumps(data), headers={"Content-Type": "application/json"})
  30.  
  31.             try:
  32.                 result.raise_for_status()
  33.             except requests.exceptions.HTTPError as err:
  34.                 print(err)
  35.             else:
  36.                 print("Sent info to discord, code {}.".format(result.status_code))
  37.         else:
  38.             print("User: " + line.strip() + " | Does Not Have The Game Pass :(")
Add Comment
Please, Sign In to add comment