-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
46 lines (37 loc) · 1.54 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from os import system
try:
import requests
import threading
except:
system("pip install requests")
system("pip install threading")
def rfriends(userid, amount):
with open('cookies.txt', 'r') as cookies:
cookies = cookies.read().splitlines()
batch = []
for x in cookies:
batch.append(x)
def send_friend(cookie, userid):
try:
with requests.session() as session:
check = requests.get('https://api.roblox.com/currency/balance', cookies={'.ROBLOSECURITY': str(cookie)}) #check if the cookie is valid
if check.status_code == 200:
session.cookies['.ROBLOSECURITY'] = cookie
session.headers['x-csrf-token'] = session.post('https://auth.roblox.com/v2/logout',cookies={'.ROBLOSECURITY': str(cookie)}).headers['x-csrf-token']
friend = session.post(f'https://friends.roblox.com/v1/users/{userid}/request-friendship')
if friend.status_code == 200:
print('sent')
elif 'The target user is already a friend.' in friend.text:
print('already added')
else:
print(friend.text)
except:
print('skipped')
for x in range(int(amount)):
cookie = cookies[x]
threading.Thread(target=send_friend, args=(cookie,userid,)).start()
userid = input("userid\n> ")
system("cls")
amount =input("amount\n> ")
system("cls")
rfriends(userid, amount)