我得到“ RequestsDependencyWarning:urllib3(1.25.3)或chardet(3.0.4)与支持的版本不匹配!”

问题描述 投票:0回答:1

我正在尝试下载youtube视频并上传到电报中

def start_callback(bot, update, args):
    if len(args)==1:
        search="https://www.youtube.com/results?search_query="+args[0]
    else:
        search="https://www.youtube.com/results?search_query="+("+".join(args))
        print
    response = requests.get(search)
    page = response.text
    soup = BeautifulSoup(page,"lxml")
    links=[]
    for i in soup.find_all("a",{"aria-hidden":"true"}):
        links.append("https://www.youtube.com"+i.attrs['href'])

    for i in links[:10]:
        update.message.reply_text(i)
        #bot.send_message(chat_id="@marks_channel", text=i)
        sleep(1)
    update.message.reply_text("top 10 youtube videos for the "+" ".join(args))

然后

start_handler = CommandHandler('ytsearch',start_callback, pass_args=True)
dispatcher.add_handler(start_handler)

在本地执行时,一切都很好,但是,将其部署到Heroku:云应用程序平台时,会收到此警告。

RequestsDependencyWarning:urllib3(1.25.3)或chardet(3.0.4)不会匹配支持的版本!

我已经尝试更新requests,但它没有任何改变。

我也尝试过RequestsDependencyWarning: urllib3 (1.9.1) or chardet (2.3.0) doesn't match a supported version ,但Heroku不变。

请帮助:/

python heroku telegram-bot youtube-dl
1个回答
0
投票

这解决了我的问题:https://stackoverflow.com/a/53032616/13351435

我通过ubuntu机器上的apt安装了python,并且已经通过pip安装了其他软件包。我认为这就是造成断开连接的原因。

© www.soinside.com 2019 - 2024. All rights reserved.