aCogSphereE / ecogsphere.py
CognitiveScience's picture
Update ecogsphere.py
f248660
raw
history blame
544 Bytes
import requests
import os
RA_TOKEN = os.environ.get('RA_KEY')
url = "https://youtube-search-results.p.rapidapi.com/youtube-search/"
querystring = {"q":"daniel+dennett"}
headers = {
"X-RapidAPI-Key": RA_TOKEN,
"X-RapidAPI-Host": "youtube-search-results.p.rapidapi.com"
}
def ecs(inp):
inp=querystring
if inp is None:
response = "No Input!"
else:
try:
response = requests.get(url, headers=headers, params=inp)
except NameError:
response="Wrong Input!"
return response