This commit is contained in:
deathbybandaid 2019-06-14 10:53:36 -04:00
parent a66cbdb377
commit cb45a2a305

View File

@ -36,18 +36,13 @@ class Google():
lookfor = data.replace(':', '%3A')
try:
if searchtype == 'info':
url = "http://www.google.com"
var = requests.get(r'https://www.youtube.com/search?q=' + lookfor + '&btnI', headers=header)
elif searchtype == 'maps':
url = "http://www.google.com"
elif searchtype == 'youtube':
url = "https://www.youtube.com"
else:
url = "http://www.google.com"
query = {'q': searchterm}
if searchtype == 'maps':
var = requests.get(r'http://www.google.com/maps/place/' + lookfor, headers=header)
elif searchtype == 'youtube':
var = requests.get(r'http://www.google.com/search_query?q=' + lookfor + '&btnI', headers=header)
else:
var = requests.get(url, params=query)
var = requests.get(r'http://www.google.com/search?q=' + lookfor + '&btnI', headers=header)
except Exception as e:
var = e
var = None