import urllib.request import json import webbrowser webbrowser.open('https://deepai.org/machine-learning-model/colorizer') print("dtstjbnbbbbbbbbbbbbbbbbbbbbbbrdtr") ty=[] for bb in range(127): bb=str(bb) gg='pous'+bb+'.jpg' import requests r = requests.post( "https://api.deepai.org/api/colorizer", files={ 'image': open(gg, 'rb'), }, headers={'api-key': 'b28337b1-80ae-4596-933c-d3334997b1b2'} ) print(r.json()) print("dtstrdjkkkkkkkkkkkkkkkkkkkkkkkkkktr") gg=str(r.json()) print(gg) print(gg[61:],"WWWWWWWWWWWWWWWWWWWWWW") rr=(gg[62:]) print(rr[0:-2]) endid=(rr[0:-2]) print(endid) endidwith="'"+endid+"'" print(endidwith) #webbrowser.open(endidwith) webbrowser.open(endid) import urllib.request urllib.request.urlretrieve(endid, "newpoul"+bb+".jpg") ty.append("newpoul"+bb+".jpg")