-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWhatsapp_Creator.py
178 lines (147 loc) · 5.66 KB
/
Whatsapp_Creator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
import urllib
import json
import time
import os
import math
__author__ = 'Lambasoft'
__website__ = "onlinesmsverification.xyz"
__version__ = "1.0"
debug = True
api_url = "http://api.onlinesmsverification.xyz/api.php" # Do not change this unless you know what you're doing
osms_token = "" # Place your http://onlinesmsverification.xyz token here
max_tries = 5 # Maximum number of failed tries per registration before we stop trying
save_path = ""
#Do not edit anything from below
reason = {
'bad_proxy' : False
};
counter = {
'bad_proxy' : 0,
'accounts' : 0,
'sms_tries' : 0,
'created_accounts' :0,
'tries' : 0,
"proxy" : 0
};
number = 0
def apiAction( action , parameter = ""):
fetch_url = api_url + "?token=" + osms_token + "&action=" + action + parameter
f = urllib.urlopen(fetch_url)
html = f.read()
return html
def find_between( s, first, last ):
try:
start = s.index( first ) + len( first )
end = s.index( last, start )
return s[start:end]
except ValueError:
return ""
def setProxies():
isValid = False
while not isValid:
print "We only accept proxies using the following ports: {80,8080}"
answer = raw_input("Enter proxies:port txt file path : \r\n")
if answer:
if ".txt" in answer:
if os.path.isfile(answer):
with open(answer, 'r') as f:
results = f.read().splitlines()
return [ x for x in results if (":80" or ":8080") in x ]
isValid = True
else:
print "[!] Please make sure the file exist"
isValid = False
else:
print "Proxies should be in a .txt file"
isValid = False
else:
isValid = True
return []
if __name__ == "__main__":
print " " * 9 + "-" * 42
print " " * 10 + "Author: {0} | {1}".format(__author__ , __website__)
print " " * 20 + "WhatsApp Mass Creator"
print " " * 25 + "Version: {0} ".format(__version__)
print " " * 9 + "-" * 42
print "\n\r"
if not osms_token:
osms_token = raw_input("Enter your Token: ")
data = json.loads(apiAction("balance"))
print "Your Balance is: {0}".format(data['balance'])
while (counter['accounts'] <= 0):
counter['accounts'] = input("How many WhatsApp Accounts would you like to create?\r\n")
proxies = setProxies()
while (len(proxies) < counter['accounts']):
print "Loaded " + str(len(proxies)) + " proxies."
print "Proxies should be more than accounts!"
proxies = setProxies()
print "Loaded " + str(len(proxies)) + " proxies."
while (not save_path):
save_path = raw_input("Enter Output File Name:\r\n")
print "Accounts will be saved to " + os.path.dirname(os.path.realpath("__file__")) + "/" + save_path + ".txt"
save_path = os.path.dirname(os.path.realpath("__file__")) + "/" + save_path + ".txt"
print "Creating Accounts ..."
while (counter['accounts'] > 0 and counter['tries'] <= max_tries):
if (proxies[counter['proxy']]):
proxy = proxies[counter['proxy']]
else:
print "No more proxies..."
break;
print "Loaded proxy: " + proxy
if(reason['bad_proxy'] == False):
time.sleep(10) # Do not change that or your account will get automatically banned
result = json.loads(apiAction("getMobile","&pid=3"))
if(result['success']):
counter['tries'] = 0
number = result['number']
print "Fetched number: " + number
else:
print "Error" + ((" '" + str(result['error']) + "' ") if debug == True else " ") + "fetching number, retrying ..."
time.sleep(10) # Do not change that or your account will get automatically banned
continue
time.sleep(10) # Do not change that or your account will get automatically banned
result = json.loads(apiAction("wapCode","&number={0}&proxy={1}".format(number,proxy)))
if(result['success']):
print "Code successfully sent to " + number
elif result['error'] == "There was a problem trying to request the code":
print "Error" + ((" '" + str(result) + "' ") if debug == True else " ") + "while sending SMS to " + str(number) + " retrying with new number..."
reason['bad_proxy'] = False
counter['tries'] += 1
continue
else:
print "Error" + ((" '" + str(result['error']) + "' ") if debug == True else " ") + "while sending SMS to " + str(number) + " retrying with new proxy..."
reason['bad_proxy'] = True
counter['tries'] += 1
counter['proxy'] += 1
continue
sms_code = ""
while (not sms_code and counter['sms_tries'] < 5):
print "[{0}] Attempting to receive SMS ...".format(counter['sms_tries']+1)
time.sleep(15) # Do not change that or your account will get automatically banned
result = json.loads(apiAction("getSMS","&pid=3&number="+number))
if(result['success'] and result['received']):
sms_code = find_between(result['message'].lower(),"whatsapp code",".").strip()
print "Received Code: " + sms_code
counter['sms_tries'] += 1
if(not sms_code):
print "Failed receiving SMS Code, retrying with new number..."
time.sleep(10) # Do not change that or your account will get automatically banned
counter['tries'] += 1
continue
time.sleep(10) # Do not change that or your account will get automatically banned
result = json.loads(apiAction("wapVerCode","&code={0}&number={1}&proxy={2}".format(sms_code,number,proxy)))
if(result['success']):
print "Successfully Created Account\r\n{0}\r\n{1}".format(result['username'],result['password'])
f = open(save_path,'a+')
f.write(result['username'] + ":" + result['password'] + "\n")
f.close()
counter['accounts'] -= 1
counter['created_accounts'] += 1
counter['tries'] = 0
counter['sms_tries'] = 0
reason['bad_proxy'] = False
counter['proxy'] += 1
else:
print "Error: " + result['error']
if (counter['tries'] >= max_tries):
print "Too many consecutive fails, exiting..."