-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathreverseimagesearch.py
More file actions
25 lines (23 loc) · 829 Bytes
/
reverseimagesearch.py
File metadata and controls
25 lines (23 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import requests
import webbrowser
R = '\033[31m' # red
G = '\033[32m' # green
C = '\033[36m' # cyan
W = '\033[0m' # white
def reverseimagesearch():
try:
img=input(C+"root@osint:"+W+"~/#Enter the image path:")
print ( W + '[+]' + G + 'Fetching...' + '\n')
surl='https://www.google.co.in/searchbyimage/upload'
murl={'encoded_image': (img, open(img, 'rb')), 'image_content': ''}
response = requests.post(surl, files=murl, allow_redirects=False)
fetchUrl = response.headers['Location']
openWeb = input(C+"Open Search Result in web broser? (Y/N) : "+W)
if openWeb.upper() == 'Y':
webbrowser.open(fetchUrl)
else:
pass
except IOError:
print()
print(R+"ERROR : File Does not Exist\n")
reverseimagesearch()