Hi,
I have the below code to download film strips for a shot but it takes 2-3 seconds which is rather slow for a 188K file. Obviously it’s not the download itself but the DB queries that are the bottleneck.
Does anybody know how to speed this up?
Cheers,
frank
start = time.time()
print("getting url")
sg = shotgun_api3.Shotgun(server, script, key)
data = sg.find_one("Shot", [["id", "is", 8832]], ["image", "filmstrip_image"])
out_img_path = "/tmp/test_filmstrip.jpg"
print("downloading")
response = requests.get(data["filmstrip_image"])
with open(out_img_path, "wb") as out_file:
out_file.write(response.content)
end = time.time()
print(end-start)