fbchat-dev / fbchat

Facebook Chat (Messenger) for Python
https://fbchat.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.19k stars 412 forks source link

Error when sending request: Got 500 response. #663

Closed badhacker0x1 closed 2 years ago

badhacker0x1 commented 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()