Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # this will add a banned user to your friends list
- # you need to input authorization and usernames
- import requests
- acc_cookie = "" # place your account .roblosecurity cookie here
- banned_cookie = "" # place your banned account .roblosecurity cookie here
- acc_username = "" # your username
- banned_username = "" # username of banned user
- class roblox:
- def __init__(self):
- self.xsrf = ""
- self.session = requests.Session()
- self.session.headers["User-Agent"] = "Roblox/WinInet"
- def update_cookie(self, cookie): self.session.cookies[".ROBLOSECURITY"] = cookie
- def get_userid(self, username): return self.session.get("https://api.roblox.com/users/get-by-username?username="+username).json()["Id"]
- def send_request(self, userId):
- resp = self.session.post(
- url="https://www.roblox.com/api/friends/sendfriendrequest",
- headers={"X-CSRF-TOKEN": self.xsrf},
- json={"targetUserID": userId}
- )
- if "X-CSRF-TOKEN" in resp.headers:
- self.xsrf = resp.headers["X-CSRF-TOKEN"]
- return self.send_request(userId)
- return resp.text
- def accept_request(self, userId):
- resp = self.session.post(
- url="https://api.roblox.com/user/accept-friend-request",
- headers={"X-CSRF-TOKEN": self.xsrf},
- json={"requesterUserId": userId}
- )
- if "X-CSRF-TOKEN" in resp.headers:
- self.xsrf = resp.headers["X-CSRF-TOKEN"]
- return self.accept_request(userId)
- return resp.text
- roblox = roblox()
- if acc_cookie and banned_cookie:
- roblox.update_cookie(acc_cookie)
- send_resp = roblox.send_request(roblox.get_userid(banned_username))
- roblox.update_cookie(banned_cookie)
- accept_resp = roblox.accept_request(roblox.get_userid(acc_username))
- print(send_resp, accept_resp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement