-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
74 lines (59 loc) · 1.94 KB
/
main.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
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from random import choice
from string import ascii_letters, digits
import threading
from cg import CyberGhost
__author__ = 'whoami'
__version__ = '0.1.2'
__date__ = '02.01.16 13:26'
__description__ = """
Helper for regidtration accounts in cyberghostvpn.com
Первым закроется тот драйвер что был первым открыт!
"""
OUTFILE = "users.txt"
FROMFILE = "in.txt"
REGURL = "https://account.cyberghostvpn.com/en_us/create?"
XPATH = dict(
puk=".//*[@id='loginForm']/div[2]/form/input[3]",
login=".//*[@id='loginForm']/div[1]/div[2]/form/input[1]",
passwd=[".//*[@id='loginForm']/div[1]/div[2]/form/input[2]",
".//*[@id='loginForm']/div[1]/div[2]/form/input[3]", ],
)
def generation_passwd(length):
spec = '!@#$%&*?^'
all_symbols = digits + ascii_letters
res = []
for _ in range(length):
res.append(choice(all_symbols))
password = ''.join(res)
return password
def thread(my_func):
"""
Декоратор для запуска функции в потоке
:param my_func: functions
:return: functions
"""
def wrapper(*args, **kwargs):
my_thread = threading.Thread(target=my_func, args=args, kwargs=kwargs)
my_thread.start()
return wrapper
@thread
def main():
cg = CyberGhost(None, XPATH, None, REGURL)
cg.driver_start()
login, passwd = generation_passwd(6), generation_passwd(6)
cg.registration([login, passwd])
puk = input(login + " press enter to close:\n")
cg.driver_stop()
with open(OUTFILE, 'a') as f:
f.writelines(':'.join((login, passwd, puk,)))
f.write('\n')
if __name__ in "__main__":
count = int(input("Type count:"))
threads_limit = int(input("Count thread:"))
threads_limit += threading.active_count()
for i in range(int(count)):
while threading.active_count() >= threads_limit:
pass
main()