File size: 544 Bytes
c9b6101
 
 
 
 
 
 
 
 
 
 
 
 
 
16d05f3
f248660
 
 
 
 
 
 
 
 
 
 
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
26
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