嗨,我有一个python脚本,查找视频流,如果流被找到,它将做一些事情。
当streamlink没有找到流时,它显示一条消息(这是标准功能)"Could NOT get video info - ERROR: video unavailable"
在文档中它说你可以写一个日志文件,但我在一个损失…这就是我所说的
streams = streamlink.streams (channel_stream)
我如何完成该语句有streamlink日志到/var/stramlink.log
提前感谢。h
从文档来看,您可以使用会话的实例在streamlink会话上设置日志文件设置:
subprocess-errorlog (bool) Log errors from subprocesses to a file located in the temp directory
subprocess-errorlog-path (str) Log errors from subprocesses to a specific file
ffmpeg-verbose (bool) Log stderr from ffmpeg to the console
ffmpeg-verbose-path (str) Specify the location of the ffmpeg stderr log file
这些设置可以这样设置:
streamlink.set_option('subprocess-errorlog', true)
streamlink.set_option('subprocess-errorlog-path', '/path/to/streamlink_error.log')
streamlink.set_option('ffmpeg-verbose', true)
streamlink.set_option('ffmpeg-verbose-path', '/path/to/ffmpeg_error.log')