skip420

reverse_image

Aug 17th, 2021 (edited)
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. import requests
  2. import webbrowser
  3.  
  4. filePath = 'test.jpg'
  5. searchUrl = 'http://www.google.com/searchbyimage/upload'
  6. multipart = {'encoded_image': (filePath, open(filePath, 'rb')), 'image_content': ''}
  7. response = requests.post(searchUrl, files=multipart, allow_redirects=False)
  8. fetchUrl = response.headers['Location']
  9. webbrowser.open(fetchUrl)
  10.  
Add Comment
Please, Sign In to add comment