Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- username = ''
- password = ''
- userid = requests.get('http://api.roblox.com/users/get-by-username?username=' + username).json()['Id']
- place = requests.get('http://www.roblox.com/users/profile/playergames-json?userid=' + str(userid)).json()['Games'][0]['PlaceID']
- s = requests.Session()
- s.post('https://www.roblox.com/newlogin', data={'Username': username, 'Password':password, 'ReturnUrl': ''})
- token = s.get('https://www.roblox.com/places/' + str(place) + '/settings').json()['XsrfToken']
- json = s.post('https://www.roblox.com/messages/send', data={'recipientid': 2719180, 'subject': 'hi', 'body':'hi'}, headers={'X-CSRF-TOKEN': token}).json()
- print(json)
- if(json['success'] == False):
- if(json['shortMessage'] == 'RecipientPrivacySettingsTooHigh'):
- s.post('https://www.roblox.com/user/follow', data={'targetUserId': str(2719180)}, headers={'X-CSRF-TOKEN': token})
- json = s.post('https://www.roblox.com/messages/send', data={'recipientid': 2719180, 'subject': 'hi', 'body':'hi'}, headers={'X-CSRF-TOKEN': token}).json()
- print(json)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement