【问题标题】:How do you suppress "Error in the pull function" messages to stdout?如何将“拉函数错误”消息抑制到标准输出?
【发布时间】:2021-08-11 20:03:36
【问题描述】:

我正在使用youtube-dl 将我的 Discord 机器人变成音乐播放器。通过让 ffmpeg 在此错误时重新连接,我通过了 common problem 的音乐被“拉功能错误”中断。但是,我无法弄清楚如何抑制发送到标准输出的错误消息:

[tls @ 0000023ea3564e80] Error in the pull function.
[https @ 0000023ea3560d80] Will reconnect at 327680 in 0 second(s), error=I/O error.

我的ytdl选项和ffmpeg选项如下:

YTDL_OPTIONS = \
{"format": "bestaudio",
 "noplaylist": True,
 "quiet": True}
FFMPEG_OPTIONS = \
{"before_options": "-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5",
 "options": "-vn"}

我尝试了各种 YTDL 选项,例如 "no_warnings": False"debug_printtraffic": False"progress_hooks": [] 等。但是,这些添加都不起作用。老实说,我什至不知道这些消息的来源(youtube-dl 或 discord.py 本身)。有没有办法抑制这些消息?

【问题讨论】:

    标签: python-3.x ffmpeg discord.py youtube-dl


    【解决方案1】:

    您应该可以使用ignoreerrors flag 来做到这一点。

    【讨论】:

    • 没有任何改变。由于我在FFMPEG_OPTIONS 中的before_options,机器人已经不会因为下载错误而停​​止。尽管YTDL_OPTIONS 中有新的ignoreerrors 标志,但仍会显示“拉取函数中的错误”和“将在...处重新连接”消息。
    猜你喜欢
    • 1970-01-01
    • 2012-08-11
    • 1970-01-01
    • 1970-01-01
    • 2011-03-09
    • 2020-01-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多