Spaces:
Runtime error
Runtime error
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 ecf(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 |