File size: 425 Bytes
9d4363a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import json
urls= json.load(open("research/urls.json"))
from tqdm import tqdm
import requests
i=0
for url in tqdm(urls):
filename= f"ai_gen_images/image_{i}.png"
i+=1
try:
response= requests.get(url)
if response.ok:
with open(filename, "wb") as f:
f.write(response.content)
else:
print("response not ok: ", url)
except:
print(url)
|