Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def buildjson(accts, proxies, sizes, auth, startacct, startproxy):
- """
- accts file: user:pass
- proxy file: ip:port:user:pass
- """
- acctcount = 0
- proxycount = 0
- file = open('data.json', 'w')
- if accts != "":
- acctlen = sum(1 for line in open(accts))
- accts = open(accts)
- if proxies != "":
- proxylen = sum(1 for line in open(proxies))
- proxies = open(proxies)
- file.write('{\n')
- if accts != "":
- file.write(' "accounts": {\n')
- for acct in accts:
- if acctcount == 0:
- acct = acct.strip("\n")
- format = acct.split(":")
- user = format.index("user")
- pw = format.index("pass")
- startacct -= 1
- else:
- lst = acct.split(":")
- file.write(' "'+str(startacct)+'": {\n')
- file.write(' "carted": "0",\n')
- file.write(' "password": "'+lst[pw].strip("\n")+'",\n')
- file.write(' "size": "' + random.choice(sizes) + '",\n')
- file.write(' "username": "'+lst[user].strip("\n")+'"\n')
- if acctcount == acctlen-1:
- file.write(' }\n')
- else:
- file.write(' },\n')
- acctcount += 1
- startacct += 1
- file.write(' },\n')
- if proxies != "":
- file.write(' "proxies": {\n')
- for proxy in proxies:
- if proxycount == 0:
- startproxy -= 1
- proxy = proxy.strip("\n")
- format = proxy.split(":")
- if auth == True:
- user = format.index("user")
- pw = format.index("pass")
- ip = format.index("ip")
- port = format.index("port")
- else:
- lst = proxy.split(":")
- file.write(' "' + str(startproxy) + '": {\n')
- file.write(' "ip": "'+lst[ip].strip("\n")+'",\n')
- if auth == True:
- file.write(' "password": "' + lst[pw].strip("\n") + '",\n')
- else:
- file.write(' "password": "",\n')
- file.write(' "port": "' + lst[port].strip("\n") + '",\n')
- if auth == True:
- file.write(' "username": "' + lst[user].strip("\n") + '"\n')
- else:
- file.write(' "username": ""\n')
- if proxycount == proxylen-1:
- file.write(' }\n')
- else:
- file.write(' },\n')
- proxycount += 1
- startproxy += 1
- file.write(' }\n')
- file.write('}')
- def main():
- print("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$")
- print("$ __ __ _____ $")
- print("$ | \\/ | ___ _ __ ___ ___| ___|__ _ __ ___ ___ $")
- print("$ | |\\/| |/ _ \\ '_ ` _ \\ / _ \ |_ / _ \\| '__/ __/ _ \\$")
- print("$ | | | | __/ | | | | | __/ _| (_) | | | (_| __/$")
- print("$ |_|__|_|\\___|_| |_| |_|\\___|_| \\___/|_| \\___\\___|$")
- print("$ / ___|___ _ ____ _____ _ __| |_ ___ _ __ $")
- print("$ | | / _ \\| '_ \\ \\ / / _ \\ '__| __/ _ \\ '__| $")
- print("$ | |__| (_) | | | \\ V / __/ | | || __/ | $")
- print("$ \\____\\___/|_| |_|\\_/ \\___|_| \\__\\___|_| $")
- print("$ $")
- print("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$")
- print("")
- print("By BrianBoko The Smooth Voiced God")
- print("")
- print("Make sure your files have one line at the top to show how they are formatted!")
- print("Please use the following keywords for formatting:")
- print("user:pass:ip:port")
- print("You can arrange them in any order to correspond with your specific files.")
- print("")
- sizes = []
- while True:
- size = input("Enter at least one size to add to your account list then hit enter with no data to continue: ")
- if size == "":
- break
- else:
- sizes.append(size)
- accts = input("Enter the accounts txt file (or press enter for proxies only): ")
- proxies = input("Enter the proxies txt file (or press enter for accounts only): ")
- auth = input("Are you using authenticated proxies (Y/N): ")
- if auth == "Y":
- auth = True
- startacct = input("Enter a number to start your account conversion from (Makes it easier to copy paste newly converted accounts to old json file. Enter 0 if starting fresh.)")
- startproxy = input("Enter a number to start your proxy conversion from (Makes it easier to copy paste newly converted accounts to old json file. Enter 0 if starting fresh.)")
- buildjson(accts, proxies, sizes, auth, int(startacct), int(startproxy))
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement