I am trying to write a script that compares images, and tells me whether or not the images are the same. Here is some minimal code:
import requests
url1 = 'https://scontent-lga3-1.cdninstagram.com/vp/b4577921aa35369af8980a3d563e4373/5DAE3C31/t51.2885-15/fr/e15/s1080x1080/66126877_342437073345261_1373504971257332049_n.jpg?_nc_ht=scontent-lga3-1.cdninstagram.com'
url2 = 'https://scontent-lga3-1.cdninstagram.com/vp/fab3372181d5ad596280d2c095a3496e/5DE99775/t51.2885-15/e35/67547020_369706770411768_8601267197685673619_n.jpg?_nc_ht=scontent-lga3-1.cdninstagram.com'
print(requests.Session().get(url1).content == requests.Session().get(url2).content)
However, if you manually navigate to each url you will see that the photos are the same. My question; Can I compare these images WITHOUT having to save them to a directory? I was thinking about perhaps reading these images both as binary, then doing the comparison, however I have no idea how to do that on the fly. Thanks for all of those who reply in advance.