You can rotate through the proxies without defining a separate function for it. After you make the list, you can just loop over it.
def get_proxies():
proxies = ['128.199.254.244:3128', '95.85.79.54:53281', '128.199.125.54:2468', '178.45.8.113:53281', '206.189.225.30:3128']
return proxies
proxArr = get_proxies()
for proxy in proxArr:
print(proxy)
You can make a call to the required function instead of printing it out.
EDIT
You can use the zip() function to create an iterator over multiple such lists. It will work something like this:
def get_cc():
cc = ['56465465465465', '4654654654654', '54654654654654']
return cc
def get_proxies():
proxies = ['128.199.254.244:3128', '95.85.79.54:53281', '128.199.125.54:2468', '178.45.8.113:53281', '206.189.225.30:3128']
return proxies
proxArr = get_proxies()
ccArr = get_cc()
for elem in zip(proxArr, ccArr):
spotify(elem[0], elem[1])
EDIT 2
Your spotify function should take in 3 elements as well:
def spotify(elem1, elem2, elem3):
print("proxy: {}, cc: {}, cvc: {}".format(elem1, elem2, elem3))
EDIT 3
If I understand correctly, this should fix your issue. You should take out the re-run logic from the function and into the loop:
import sys
def spotify(elem1, elem2, elem3):
print("proxy: {}, cc: {}, cvc: {}".format(elem1, elem2, elem3))
def get_cc():
cc = ['5136154545452522', '51365445452823', '51361265424522']
return cc
def get_cvc():
cvc = ['734', '690', '734']
return cvc
def get_proxies():
proxies = ['51.77.545.171:8080', '51.77.254.171:8080', '51.77.258.82:8080']
return proxies
proxArr = get_proxies()
ccArr = get_cc()
cvcArr = get_cvc()
yeslist = ['y','yes']
for elem in zip(proxArr, ccArr, cvcArr):
spotify(elem[0], elem[1], elem[2])
restart=input("Do you wish to start again: ").lower()
if restart not in yeslist:
sys.exit("Exiting")