Advertisement
Guest User

Untitled

a guest
Jan 10th, 2017
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.47 KB | None | 0 0
  1. # _*_ coding:ascii _*_
  2.  
  3. from termcolor import colored as c
  4. from getpass import getpass
  5. from requests import get, post, Session as session
  6. from json import loads
  7. import os
  8. import re
  9. import imghdr
  10. import requests
  11. #
  12. class account:
  13. username = '' # Your account username.
  14. password = '' # Your account password.
  15. group = '' # Leave this at blank if you don't want to upload to group.
  16. price = 5 # Leave this at 0 if you don't want to sell.
  17. desc = '''
  18. telamon builderman shirt t-shirt pwn pwnage pwned epic cool jean clothes muscle cloak armor hoodie jacket free DC Camo Camouflague Camouflage camoflage American Eagle admin vip funny awesome fun cheap best selling paintball skate camo army general private christmas elf elves presents pvt gun ninja armour halloween summer spring girl man boy woman winter fall autumn dead killed own ownage owned 1337 leet SWAT black green yellow orange purple blue red white toon stealth assassin default 2006 2007 2008 2009 2010 2011 2012 tix tickets robux suit tux tuxedo top F.E.A.R. FEAR RAT R.A.T. UCR U.C.R. uniform fusion olympics x-101st jesus christ god batman spiderman superman hulk iron man indiana jones wii jersey soccer football basketball baseball pirate soldier future futuristic free cool tight dog dawg animals formal peace love chest hair arm hair back hair and happiness hate h8
  19. '''# Default description.
  20. #
  21. d_session = session()
  22. d_title = 'Shirter V1.1'
  23. d_title_2 = 'by '
  24. d_creator = '@owlv3rm'
  25. d_color_1 = 'green'
  26. d_color_2 = 'white'
  27. #
  28. requests.packages.urllib3.disable_warnings()
  29. #
  30. def login(u = account.username, p = account.password, s = d_session):
  31. captcha_message = 'Please fill out the CAPTCHA correctly'
  32. success_message = 'Update Status'
  33. bad_message = 'Wrong username or password'
  34. twofa_message = 'Please enter the Identification code.'
  35. r = s.post('https://m.roblox.com/login', verify = False, data = {'UserName':u,'Password':p})
  36. if captcha_message and 'keep in touch' in r.content:
  37. return 'CAPTCHA'
  38. elif success_message in r.content:
  39. return 'SUCCESS'
  40. elif twofa_message in r.content:
  41. return '2FA'
  42. elif bad_message and 'keep in touch' in r.content:
  43. return 'BAD'
  44. def clear():
  45. if os.name == 'nt' or os.name == 'dos':
  46. os.system('cls')
  47. elif os.name == 'linux' or os.name == 'osx' or os.name == 'posix':
  48. os.system('clear')
  49. else:
  50. print ('\n' * 120)
  51. def title():
  52. print c(d_title, d_color_1).center(50)
  53. print (c(d_title_2, d_color_1) + c(d_creator, d_color_2)).center(58)
  54. print ''
  55. def getids(z, ses=d_session):
  56. # print z
  57. aa = []
  58. for i in range(int(z[0]), int(z[1])):
  59. a=ses.get('http://search.roblox.com/catalog/json?CatalogContext=1&Subcategory=12&SortType=2&SortAggregation=5&LegendExpanded=true&Category=3&PageNumber=' + str(i)).json
  60. for asset in a():
  61. aa.append(str(asset['AssetId']))
  62. return aa
  63. def upload(data, name, typeid, ses = d_session):
  64. datatype = imghdr.what(None, data)
  65. rvt = re.findall('Token.+value?=?\"(.+)\"', ses.get('https://www.roblox.com/build/upload').content)[0]
  66. d=ses.post('https://www.roblox.com/build/upload', data = {
  67. '__RequestVerificationToken': rvt,
  68. 'assetTypeId': typeid,
  69. 'isOggUploadEnabled': 'True',
  70. 'isTgaUploadEnabled': 'True',
  71. 'groupId': account.group,
  72. 'onVerificationPage': 'False',
  73. 'name': name
  74. }, files = {
  75. 'file': ('template.' + datatype, data, 'image/' + datatype)
  76. }, verify = False).content
  77. return re.search('\.com/.+-.+id=(.+)\".+target', d).group(1)
  78. def updatePrice(aid, price, name, ses = d_session):
  79. url = 'https://www.roblox.com/my/Item.aspx?id='+aid
  80. req1 = ses.get(url).content
  81. # print url
  82. s = '$'
  83. data = {
  84. '__EVENTTARGET': 'ctl00$cphRoblox$SubmitButtonTop',
  85. '__EVENTARGUMENT': '',
  86. '__VIEWSTATE': re.search('__VIEWSTATE\" value=\"(.+)\" />', req1).group(1),
  87. '__VIEWSTATEGENERATOR': re.search('__VIEWSTATEGENERATOR\" value=\"(.+)\" />', req1).group(1),
  88. '__PREVIOUSPAGE': re.search('__PREVIOUSPAGE\" value=\"(.+)\" />', req1).group(1),
  89. '__EVENTVALIDATION': re.search('__EVENTVALIDATION\" value=\"(.+)\" />', req1).group(1),
  90. 'ctl00' + s + 'cphRoblox' + s + 'NameTextBox': name,
  91. 'ctl00' + s + 'cphRoblox' + s + 'DescriptionTextBox': account.desc,
  92. 'ctl00' + s + 'cphRoblox' + s + 'SellThisItemCheckBox': 'on',
  93. 'ctl00' + s + 'cphRoblox' + s + 'SellForRobux': 'on',
  94. 'ctl00' + s + 'cphRoblox' + s + 'RobuxPrice': price,
  95. 'ctl00' + s + 'cphRoblox' + s + 'EnableCommentsCheckBox': 'on',
  96. 'GenreButtons2': '1',
  97. 'ctl00' + s + 'cphRoblox' + s + 'actualGenreSelection': '5'
  98. }
  99. #print re.findall('value=\"(.+)\"', req1)
  100. return ses.post(url, data = data).url
  101. #
  102. def main():
  103. clear()
  104. title()
  105. if account.username == '' or account.password == '':
  106. print c('Username or password not set, please enter account info below.', 'yellow')
  107. account.username = raw_input('Username: ')
  108. account.password = getpass('Password: ')
  109. else:
  110. print c('Account details already set...', 'green')
  111. print c('Logging into account...', 'green')
  112. attempt = login()
  113. if attempt == 'CAPTCHA':
  114. print c('Captcha detected, please fill it out in the link below and press enter:', 'red')
  115. print 'https://www.roblox.com/Login/iFrameLogin.aspx'
  116. raw_input()
  117. main()
  118. elif attempt == 'BAD':
  119. print c('Bad username or password, press enter to try again', 'red')
  120. account.username = ''
  121. account.password = ''
  122. raw_input()
  123. main()
  124. elif attempt == '2FA':
  125. print c('It looks like you have enabled Two Factor Authentication on your account, please disable it and press enter.', 'yellow')
  126. raw_input()
  127. main()
  128. elif attempt == 'SUCCESS':
  129. def main2():
  130. clear()
  131. title()
  132. print c('Enter asset ID\'s to copy seperated by commas:', 'yellow')
  133. ids = raw_input()
  134. if ids[:4] != 'page':
  135. ids = ids.split(',')
  136. else:
  137. ids = getids(ids[5:].split(':'))
  138. for aid in ids:
  139. ainfo = re.sub(r'[^\x00-\x7f]', r'', d_session.get('https://api.roblox.com/Marketplace/ProductInfo?assetId=' + aid, verify=False).content)
  140. ainfo = loads(ainfo)
  141. aname = ainfo['Name']
  142. atid = ainfo['AssetTypeId']
  143. print c('Copying \'' + c(ainfo['Name'], 'white') + c('\' created by ', 'green') + c(ainfo['Creator']['Name'], 'white') + c('.', 'green'), 'green')
  144. tid = re.findall('\?id=(.+)</url', d_session.get('https://www.roblox.com/asset?id='+aid, headers={'User-Agent':'Roblox/WinInet'}, verify=False).content)[0]
  145. templatereq = d_session.get('https://www.roblox.com/asset?id=' + tid, stream=True, verify=False, headers={'User-Agent':'Roblox/WinInet'})
  146. template = templatereq.content
  147. abc = upload(template, aname, atid)
  148. def atm():
  149. try:
  150. updatePrice(abc, account.price, aname)
  151. except:
  152. pass
  153. # print'a'
  154. atm()
  155. print c('Finished, please press enter.', 'green')
  156. raw_input()
  157. main2()
  158. main2()
  159. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement