from urllib.request import urlretrieve ### #make sure artistLoRAurls.txt and this script are in the same folder!!! ### f = open('artistLoRAurls.txt', 'r') #Open .txt file loraTxt = f.read() loraPreList = loraTxt.splitlines() #Turn .txt file into a python list f.close() numLoRAs = len(loraPreList) loraList = [None]*numLoRAs index = 0 #Turn list of artists into a nested list of lists #I'm not an amazing coder, this could probably be combined with the for loop below for ii in loraPreList: #print(loraPreList[index].split(", ")) loraList[index] = loraPreList[index].split(", ") index += 1 #Loop over the nested list of lists to save the files as .safetensors for ii in range(numLoRAs): url = loraList[ii][0] artistName = loraList[ii][1] print("Downloading " + artistName + " " + str(ii+1) + " out of " + str(numLoRAs)) filename = artistName+".safetensors" #Edit this line to change filename convention urlretrieve(url, filename)