Untitled diff

Created Diff never expires
65 removals
Lines
Total
Removed
Words
Total
Removed
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
236 lines
157 additions
Lines
Total
Added
Words
Total
Added
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
327 lines
#!/usr/bin/env python2.7
# Extinc Reaper
# encoding: utf-8
# Created by NoName#9646


# Asset Reaper
# @ thetrex.net


# Encoding: NoName
try:
try:
import json, time, os, re, StringIO
import json, time, os, re, StringIO
from PIL import Image
from PIL import Image
from urllib import urlencode
from urllib import urlencode
import requests, base58
import requests, base58
from BeautifulSoup import BeautifulSoup
from BeautifulSoup import BeautifulSoup
except:
except:
print('ERROR:: missing module(s)')
print('ERROR:: missing module(s)')
exit()
exit()




settings = json.loads(open('./settings/settings', 'r').read())
NamePrefix = open('./settings/NAMEPREFIX.txt', 'r').read()
accounts = open('./settings/accounts', 'r').read().splitlines()
Price = open('./settings/PRICE.txt', 'r').read()
GroupID = open('./settings/GROUPID.txt', 'r').read()
Description = open('./settings/DESCRIPTION.txt', 'r').read()
accounts = open('./settings/ACCOUNT.txt', 'r').read().splitlines()
SecureAccount = open('./settings/ACCOUNT.txt', 'r').read()
sessions = []
sessions = []
accountIndex = 0
accountIndex = 0


if (SecureAccount == ''):
os.system('color b')
print('Accounts.txt is empty! Requires 13+ and No PIN, No 2nd Verification')
raw_input()
if (GroupID == ''):
os.system('color b')
print('GROUPID.txt is empty, Enter your Group ID !')
raw_input()
if (Price == ''):
os.system('color b')
print('PRICE.txt is empty, This is important for you to add some price and it must be a number')
raw_input()
class rbx():
class rbx():
def __init__(self):
def __init__(self):
self.session = requests.Session()
self.session = requests.Session()
def set_details(self, username, password):
def set_details(self, username, password):
"sets cookie of session object"
"sets cookie of session object"
try:
try:
request = self.session.post('https://m.roblox.com/login', data = {
request = self.session.post('https://api.roblox.com/v2/login', data = {
'UserName': username,
'username': username,
'Password': password
'password': password
})
})
if ('.ROBLOSECURITY' in self.session.cookies.keys()):
if ('.ROBLOSECURITY' in self.session.cookies.keys()):
return True
return True
except:
except:
pass
pass
return False
return False
def update(self, assetId, name, description, price):
def update(self, assetId, name, description, price):
try:
try:
updateUrl = 'https://www.roblox.com/my/item.aspx?id={}'.format(assetId)
updateUrl = 'https://web.roblox.com/my/item.aspx?id={}'.format(assetId)
request = self.session.get(updateUrl)
request = self.session.get(updateUrl)
if (request.status_code == 200):
if (request.status_code == 200):
soup = BeautifulSoup(request.content)
soup = BeautifulSoup(request.content)
data = {
data = {
'__EVENTTARGET': 'ctl00$cphRoblox$SubmitButtonTop',
'__EVENTTARGET': 'ctl00$cphRoblox$SubmitButtonTop',
'__EVENTARGUMENT': '',
'__EVENTARGUMENT': '',
'__VIEWSTATE': soup.find('input', attrs={'name': '__VIEWSTATE'}).get('value'),
'__VIEWSTATE': soup.find('input', attrs={'name': '__VIEWSTATE'}).get('value'),
'__VIEWSTATEGENERATOR': soup.find('input', attrs={'name': '__VIEWSTATEGENERATOR'}).get('value'),
'__VIEWSTATEGENERATOR': soup.find('input', attrs={'name': '__VIEWSTATEGENERATOR'}).get('value'),
'__EVENTVALIDATION': soup.find('input', attrs={'name': '__EVENTVALIDATION'}).get('value'),
'__EVENTVALIDATION': soup.find('input', attrs={'name': '__EVENTVALIDATION'}).get('value'),
'ctl00$cphRoblox$NameTextBox': name,
'ctl00$cphRoblox$NameTextBox': name,
'ctl00$cphRoblox$DescriptionTextBox': description,
'ctl00$cphRoblox$DescriptionTextBox': description,
'ctl00$cphRoblox$SellThisItemCheckBox': 'on',
'ctl00$cphRoblox$SellThisItemCheckBox': 'on',
'ctl00$cphRoblox$SellForRobux': 'on',
'ctl00$cphRoblox$SellForRobux': 'on',
'ctl00$cphRoblox$RobuxPrice': price,
'ctl00$cphRoblox$RobuxPrice': price,
'ctl00$cphRoblox$EnableCommentsCheckBox': 'on',
'ctl00$cphRoblox$EnableCommentsCheckBox': 'on',
'GenreButtons2': '1',
'GenreButtons2': '1',
'ctl00$cphRoblox$actualGenreSelection': '1'
'ctl00$cphRoblox$actualGenreSelection': '1'
}
}
request2 = self.session.post(updateUrl, data=data)
request2 = self.session.post(updateUrl, data=data)
if (request2.status_code == 200):
if (request2.status_code == 200):
return True
return True
except:
except:
pass
pass
return False
return False


def upload(self, name, assetType, datafile, groupId = 0):
def upload(self, name, assetType, datafile, groupId = 0):
try:
try:
uploadUrl = 'https://www.roblox.com/build/upload'
uploadUrl = 'https://www.roblox.com/build/upload'
request = self.session.get(uploadUrl)
request = self.session.get(uploadUrl)
soup = BeautifulSoup(request.content)
soup = BeautifulSoup(request.content)
rvt = soup.find('input', attrs={'name': '__RequestVerificationToken'})
rvt = soup.find('input', attrs={'name': '__RequestVerificationToken'})
if (rvt):
if (rvt):
rvt = rvt.get('value')
rvt = rvt.get('value')
uploadRequest = self.session.post(uploadUrl, data = {
uploadRequest = self.session.post(uploadUrl, data = {
'__RequestVerificationToken': rvt,
'__RequestVerificationToken': rvt,
'assetTypeId': assetType,
'assetTypeId': assetType,
'groupId': settings['groupId'],
'groupId': GroupID,
'onVerificationPage': False,
'onVerificationPage': False,
'isOggUploadEnabled': True,
'isOggUploadEnabled': True,
'isTgaUploadEnabled': True,
'isTgaUploadEnabled': True,
'name': name
'name': name
}, files = {'file': ('image.png', datafile, 'image/png')})
}, files = {'file': ('image.png', datafile, 'image/png')})
if ('uploadedAssetId' in uploadRequest.url):
if ('uploadedId' in uploadRequest.url):
aid = re.search('uploadedAssetId=(\d+)', uploadRequest.url)
aid = re.search('uploadedId=(\d+)', uploadRequest.url)
if (aid):
if (aid):
return aid.group(1)
return aid.group(1)
elif ('later' in uploadRequest.url):
elif ('later' in uploadRequest.url):
print '-- UPLOAD BALANCING --'
print '-- UPLOAD BALANCING --'
time.sleep(60)
time.sleep(60)
else:
else:
print 'ERROR:: unknown, {}'.format(uploadRequest.url)
print 'ERROR:: unknown, {}'.format(uploadRequest.url)
except:
except:
pass
pass

def upload2(self, name, assetType, datafile, groupId = 0):
try:
uploadUrl = 'https://www.roblox.com/build/upload'
request = self.session.get(uploadUrl)
soup = BeautifulSoup(request.content)
rvt = soup.find('input', attrs={'name': '__RequestVerificationToken'})
if (rvt):
rvt = rvt.get('value')
uploadRequest = self.session.post(uploadUrl, data = {
'__RequestVerificationToken': rvt,
'assetTypeId': assetType,
'onVerificationPage': False,
'isOggUploadEnabled': True,
'isTgaUploadEnabled': True,
'name': name
}, files = {'file': ('image.png', datafile, 'image/png')})
if ('uploadedId' in uploadRequest.url):
aid = re.search('uploadedId=(\d+)', uploadRequest.url)
if (aid):
return aid.group(1)
elif ('later' in uploadRequest.url):
print '-- UPLOAD BALANCING --'
time.sleep(60)
else:
print 'ERROR:: unknown, {}'.format(uploadRequest.url)
except:
pass
class catalog():
class catalog():
"""catalog api"""
"""catalog api"""
def __init__(self):
def __init__(self):
pass
pass
@classmethod
@classmethod
def search(self, CatalogContext = 1, PageNumber = 1, Subcategory = '', Category = '', SortType = '', AggregationFrequency = '', Keyword = ''):
def search(self, CatalogContext = 1, PageNumber = 1, Subcategory = '', Category = '', SortType = '', AggregationFrequency = '', Keyword = ''):
"""simple catalog search"""
"""simple catalog search"""
queryString = {}
queryString = {}
for key, value in locals().items():
for key, value in locals().items():
if (key != 'self' and key != 'queryString' and value != ''):
if (key != 'self' and key != 'queryString' and value != ''):
queryString[key] = value
queryString[key] = value
queryString = urlencode(queryString)
queryString = urlencode(queryString)
searchUrl = 'https://search.roblox.com/catalog/json?{}'.format(queryString)
searchUrl = 'https://search.roblox.com/catalog/json?{}'.format(queryString)
try:
try:
request = requests.get(searchUrl.format(queryString))
request = requests.get(searchUrl.format(queryString))
if (request.status_code == 200):
if (request.status_code == 200):
return request.json()
return request.json()
except:
except:
pass
pass
return {}
return {}
@classmethod
@classmethod
def getData(self, assetId):
def getData(self, assetId):
"""gets data for asset"""
"""gets data for asset"""
assetUrl = 'https://assetgame.roblox.com/asset/?id={}'
assetUrl = 'https://assetgame.roblox.com/asset/?id={}'
try:
try:
request = requests.get(assetUrl.format(assetId))
request = requests.get(assetUrl.format(assetId))
if (request.status_code == 200):
if (request.status_code == 200):
soup = BeautifulSoup(request.content)
soup = BeautifulSoup(request.content)
return soup
return soup
except:
except:
pass
pass


def save_asset(asset):
def save_asset(asset):
"""saves the asset as a file"""
"""saves the asset as a file"""
nameString = '{0}_!_{1}'.format(asset['Name'].encode('utf-8').strip(), asset['AssetTypeID'])
nameString = '{0}_!_{1}'.format(asset['Name'].encode('utf-8').strip(), asset['AssetTypeID'])
filename = base58.b58encode(nameString)+'.png'
filename = base58.b58encode(nameString)+'.png'
try:
try:
xmlData = catalog.getData(asset['AssetId'])
xmlData = catalog.getData(asset['AssetId'])
if (xmlData):
if (xmlData):
dataUrl = xmlData.content.url.text
dataUrl = xmlData.content.url.text
dataRequest = requests.get(dataUrl)
dataRequest = requests.get(dataUrl)
if (dataRequest.status_code == 200):
if (dataRequest.status_code == 200):
data = StringIO.StringIO(dataRequest.content)
data = StringIO.StringIO(dataRequest.content)
filepath = './files/{}'.format(filename)
filepath = './files/{}'.format(filename)
img = Image.open(data)
img = Image.open(data)
img.save(filepath)
img.save(filepath)
return True
return True
except:
except:
pass
pass
return False
return False


def start_upload():
def start_upload():
"""uploads assets"""
"""uploads assets"""
global accountIndex
global accountIndex
global uploadCount
global uploadCount
for account in accounts:
for account in accounts:
username, password = account.split(':')
username, password = account.split(':')
session = rbx()
session = rbx()
if (session.set_details(username, password) == True):
if (session.set_details(username, password) == True):
sessions.append(session)
sessions.append(session)
else:
else:
print 'Invalid account: {}'.format(username)
print 'Invalid account: {}'.format(username)


for filename in os.listdir('./files'):
for filename in os.listdir('./files'):
name, typeId = base58.b58decode(filename.replace('.png', '')).split('_!_')
name, typeId = base58.b58decode(filename.replace('.png', '')).split('_!_')
session = sessions[accountIndex]
session = sessions[accountIndex]
name = '{0}{1}'.format(settings['namePrefix'], name)
name = '{0}{1}'.format(NamePrefix, name)
uploadAttempt = session.upload(name, typeId, open('./files/{}'.format(filename), 'rb'), settings['groupId'])
uploadAttempt = session.upload(name, typeId, open('./files/{}'.format(filename), 'rb'), GroupID)
if ((accountIndex+1) >= len(sessions)):
if ((accountIndex+1) >= len(sessions)):
accountIndex = 0
accountIndex = 0
else:
else:
accountIndex += 1
accountIndex += 1
if (uploadAttempt):
if (uploadAttempt):
if (session.update(uploadAttempt, name, settings['description'], settings['price']) == True):
if (session.update(uploadAttempt, name, Description, Price) == True):
print 'Uploaded - {0}'.format(uploadAttempt)
print 'The Asset Has Been Uploaded - {0} - {1} - Price: {2}'.format(uploadAttempt, name, Price)

def start_upload2():
"""uploads assets"""
global accountIndex
global uploadCount
for account in accounts:
username, password = account.split(':')
session = rbx()
if (session.set_details(username, password) == True):
sessions.append(session)
else:
print 'Invalid account: {}'.format(username)


for filename in os.listdir('./files'):
name, typeId = base58.b58decode(filename.replace('.png', '')).split('_!_')
session = sessions[accountIndex]
name = '{0}{1}'.format(NamePrefix, name)
uploadAttempt2 = session.upload2(name, typeId, open('./files/{}'.format(filename), 'rb'))
if ((accountIndex+1) >= len(sessions)):
accountIndex = 0
else:
accountIndex += 1
if (uploadAttempt2):
if (session.update(uploadAttempt2, name, Description, Price) == True):
print 'The Asset Has Been Uploaded - {0} - {1} - Price: {2}'.format(uploadAttempt2, name, Price)
def start_download(at, sb, af, kw, s, e):
def start_download(at, sb, af, kw, s, e):
"""downloads assets"""
"""downloads assets"""
for pageNumber in range(int(s), int(e)):
for pageNumber in range(int(s), int(e)):
results = catalog.search(PageNumber = pageNumber, Subcategory = at, Category = 3, Keyword = kw, AggregationFrequency = af, SortType = sb)
results = catalog.search(PageNumber = pageNumber, Subcategory = at, Category = 3, Keyword = kw, AggregationFrequency = af, SortType = sb)
for a in results:
for a in results:
saveAttempt = save_asset(a)
saveAttempt = save_asset(a)
print 'Downloaded - {0} - {1} - "{2}"'.format(a['AssetId'], saveAttempt, a['Name'].encode('utf-8').strip()[:15])
print 'Asset Saved - {0} - {1} - "{2}"'.format(a['AssetId'], saveAttempt, a['Name'].encode('utf-8').strip()[:15])


def ui_main():
def ui_main():
def title():
def title():
print ('\n' * 100)
os.system('color A')
print 'Asset Reaper @ thetrex.net\n'
print 'Created By NoName#9646 Contact Me If You Need Help'
print 'Dont Leak If We Find Out That Your Leaking It We Will BlackList You'
print '---------------------------ExtincReaper---------------------------'
def ui_download():
def ui_download():
print '> download > settings > asset type'
os.system('cls')
print '12 - shirts'
print '13 - t-shirts'
print '14 - pants'
assettype = raw_input('$ ')
title()
title()
print '> download > settings > sort-by'
print '> Download > Settings > Clothing Or Asset Type'
print '0 - relevance'
print '12 - Shirts'
print '1 - most favorited'
print '13 - T-Shirts'
print '2 - bestselling'
print '14 - Pants'
print '3 - recently updated'
assettype = raw_input('Select Clothing Or Asset Type > ')
print '4 - price low to high'
os.system('cls')
print '5 - price high to low'
sortby = raw_input('$ ')
title()
title()
print '> download > settings > aggregation frequency'
print '> Download > Settings > Sort-By'
print '0 - past day'
print '0 - Relevance'
print '1 - past week'
print '1 - Most Favorited'
print '2 - past month'
print '2 - BestSelling'
print '3 - all time'
print '3 - Recently Updated'
aggregationfrequency = raw_input('$ ')
print '4 - Price Low to High'
print '5 - Price High to Low'
sortby = raw_input('Select SortType > ')
os.system('cls')
title()
title()
print '> download > settings > keyword'
print '> Download > Settings > Date'
keyword = raw_input('$ ')
print '0 - Past Day'
print '1 - Past Week'
print '2 - Past Month'
print '3 - All Time'
aggregationfrequency = raw_input('Select Date > ')
os.system('cls')
title()
title()
print '> download > settings > start page'
print '> Download > Settings > Prefixes'
start = raw_input('$ ')
keyword = raw_input('Prefixes > ')
os.system('cls')
title()
title()
print '> download > settings > end page'
print '> Download > Settings > Start Page'
end = raw_input('$ ')
start = raw_input('Starting Page > ')
os.system('cls')
title()
print '> Download > Settings > End Page'
end = raw_input('End Page > ')
os.system('cls')
title()
title()
start_download(assettype, sortby, aggregationfrequency, keyword, start, end)
start_download(assettype, sortby, aggregationfrequency, keyword, start, end)
def ui_upload():
def ui_upload():
print '> upload'
print 'Uploading Clothes To Your Group'
start_upload()
start_upload()
def ui_upload2():
print 'Uploading Clothes To Your Group'
start_upload2()
title()
title()
print '> select mode'
print '> Select Mode'
print '1 - download'
print '1 - Download Clothing'
print '2 - upload'
print '2 - Upload Clothing'
user_input = raw_input('$ ').lower()
print '3 - Upload Asset To Your Inventory'
user_input = raw_input('> ').lower()
if (user_input == '1'):
if (user_input == '1'):
title()
title()
ui_download()
ui_download()
elif (user_input == '2'):
elif (user_input == '2'):
os.system('cls')
title()
title()
ui_upload()
ui_upload()
elif (user_input == '3'):
os.system('cls')
title()
ui_upload2()
ui_main()
ui_main()