Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- import csv
- import sys
- getid = 'https://privatemessages.roblox.com/v1/messages'
- cookietxt = open('cookie.txt','r')
- cookie = {'.ROBLOSECURITY': cookietxt.read()}
- for times in range(0, 3):
- for i in range(0, 10):
- try:
- token = requests.post('https://auth.roblox.com/v1/login', cookies = cookie)
- token1 = (token.headers['x-csrf-token'])
- requestheader = {'Accept': 'application/json', 'X-CSRF-TOKEN': token1,'Content-Type': 'application/json',}
- params = (
- ('pageNumber', i),
- ('pageSize', '20'),
- ('messageTab', 'Inbox'),
- )
- response = requests.get('https://privatemessages.roblox.com/v1/messages', headers=requestheader, params=params, cookies=cookie)
- data = response.json()
- fudgeyoulist = ["You have a Trade request from", "Your trade with"]
- list1 = []
- for x in response.json()["collection"]:
- if x['sender']['id'] == 1:
- doesitpass = False
- for fudge in fudgeyoulist:
- if x['subject'].find(fudge):
- doesitpass = True
- if doesitpass:
- list1.insert(len(list1) + 1, x['id'])
- #Archive
- headers = {'Accept': 'application/json',}
- json_data1 = { "messageIds": list1 }
- if len(list1):
- archiver = requests.post('https://privatemessages.roblox.com/v1/messages/archive', headers=requestheader, json=json_data1, cookies=cookie)
- print("Archived", len(list1))
- else:
- print("Messages have either all been archived or there were no messages")
- except Exception as e:
- print(e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement