Closed badhacker0x1 closed 2 years ago
def download(songid): url = "https://youtube-mp36.p.rapidapi.com/dl" querystring = {"id":songid} headers = { "X-RapidAPI-Key": "apikey", "User-Agent":"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11", "X-RapidAPI-Host": "youtube-mp36.p.rapidapi.com" } response = requests.request("GET", url, headers=headers, params=querystring).json() _results = response["link"] return f"{_results}"
elif "!yd" in msg: index = msg.index("!yd") query = msg[index+4:] reply = download(query) sendQuery()