-
Notifications
You must be signed in to change notification settings - Fork 22
/
main.py
72 lines (61 loc) · 1.79 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
import random
import requests
import selenium
import time
import threading
from dropconfig import *
# main menu
def menu():
print('''
Pick one.
1. Load proxies
2. Get captcha balance
3. Quit
''')
userChoice = input('Enter the action that you want to take: ')
choices = {
1: load_proxies,
2: captcha_balance,
3: quit
}
try:
choices[int(userChoice)]()
except:
print('Input not recognized. You probably did not enter a number. \n'
'The program will restart. \n')
menu()
finally:
Continue()
# displays 2captcha balance
def captcha_balance():
if captcha_api == '':
print('No captcha token present. Check your config file.')
else:
balance = requests.get("http://2captcha.com/res.php?key={}&action=getbalance".format(captcha_api)).text
print('\nYour 2captcha balance is {}.\n'.format(balance))
# function to load user proxies.
def load_proxies():
try:
with open('proxies.txt') as proxiesFile:
proxies = proxiesFile.read().splitlines()
print('{} proxies succesfully loaded.'.format(len(proxies)))
except IOError:
print('Error importing proxy file.')
exit()
# asks the user about continuing
def Continue():
# asks the user if they want to keep calculating, converts to lower case
keep_going = input('Do you want to keep going? Enter yes or no. \n'
'').lower()
# evaluates user's response.
if keep_going == 'yes':
menu()
elif keep_going == 'no':
print('\nThanks for using the SplashForce!')
quit()
else:
print('\nInput not recognized. Try again.')
# run the code
if __name__ == "__main__":
print('Please read the readme on Github before using this bot.')
menu()