import csv
import codecs
import os
import requests

with open('paths.txt', 'r', encoding='utf-8') as f:
	all_data = f.readlines()
	for i in range(len(all_data)):
		datas = all_data[i].split(" https://")
		artist = datas[0]
		img_url = datas[1][:-1]
		if not os.path.exists(artist):
			os.makedirs(artist)
		file_name = img_url.split('/')[-1]
		path = './'+artist+'/'+file_name
		if not os.path.exists(path):
			r= requests.get("https://"+img_url,stream = True)
			print(path)
			with open(path, 'wb') as f:
				f.write(r.content)