biliup
biliup copied to clipboard
[BUG] 无法录制标题带有特殊字符的直播
Code of Conduct
- [x] 我已在 Release 检阅最新版本并尝试,且问题依旧
- [x] 我清楚知道,反馈非最新 Release 版的错误是无意义的
- [x] 我清楚知道,可以通过附件功能上传完整文件
运行环境
Windows11 24H2
biliup 版本
v1.0.7
所录制的主播网址
https://live.bilibili.com/5017134
错误描述
如图所示,直播间标题中带有%符号,此时无法成功创建录播文件。
在删除文件名模板中的{title}标识后,bug无法再复现
目前文件名模板为{streamer}_%Y-%m-%d_%H-%M-%S_{title},经测试使用不同的下载插件会触发不同的报错
任务平台
任务平台
version:"1.0.7"
uploader:"Noop"
huya_imgplus:true
twitch_disable_ads:true
youtube_enable_download_live:true
youtube_enable_download_playback:true
bilibili_danmaku:true
douyin_danmaku:false
douyin_quality:"origin"
huya_max_ratio:0
huya_danmaku:true
douyu_danmaku:true
douyu_rate:0
downloader:"streamlink"
filename_prefix:"{streamer}_%Y-%m-%d_%H-%M-%S_{title}"
filtering_threshold:10
douyin_protocol:"flv"
huya_protocol:"Hls"
bili_qn:10000
bili_force_source:false
bili_anonymous_origin:false
bilibili_danmaku_detail:true
bilibili_danmaku_raw:true
huya_use_wup:true
file_upload_count:
upload_filename:
sync_downloader_map:
报错日志以及其他描述(如果有)
### 日志1 streamlink/ffmpeg
Traceback (most recent call last):
0|biliup | File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python313\Lib\site-packages\biliup\engine\download.py", line 379, in start
0|biliup | ret = self.run()
0|biliup | File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python313\Lib\site-packages\biliup\engine\download.py", line 359, in run
0|biliup | retval = self.download()
0|biliup | File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python313\Lib\site-packages\biliup\engine\download.py", line 148, in download
0|biliup | return self.ffmpeg_download()
0|biliup | ~~~~~~~~~~~~~~~~~~~~^^
0|biliup | File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python313\Lib\site-packages\biliup\engine\download.py", line 217, in ffmpeg_download
0|biliup | fmt_file_name = self.gen_download_filename(is_fmt=True)
0|biliup | File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python313\Lib\site-packages\biliup\engine\download.py", line 516, in gen_download_filename
0|biliup | fmt_file_name = time.strftime(filename.encode("unicode-escape").decode(),
0|biliup | ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0|biliup | time.localtime(file_time)).encode().decode("unicode-escape")
0|biliup | ^^^^^^^^^^^^^^^^^^^^^^^^^^
0|biliup | ValueError: Invalid format string
### 日志2 stream-gears
thread '<unnamed>' panicked at /rustc/6b00bc3880198600130e1cf62b8f8a93494488cc\library\alloc\src\string.rs:2800:14:
a Display implementation returned an error unexpectedly: Error
2025-09-11 17:59:13,667 event.py80[ERROR]Tname:Asynchronous1_0 try_handler
Traceback (most recent call last):
File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python312\Lib\site-packages\biliup\engine\event.py", line 78, in try_handler
handler(event)
File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python312\Lib\site-packages\biliup\engine\event.py", line 127, in wrapper
callback(_event)
File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python312\Lib\site-packages\biliup\engine\event.py", line 111, in callback
for event in result:
^^^^^^
File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python312\Lib\site-packages\biliup\handler.py", line 57, in process
stream_info = biliup_download(name, url, config['streamers'][name].copy())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python312\Lib\site-packages\biliup\downloader.py", line 45, in biliup_download
return download(name, url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python312\Lib\site-packages\biliup\downloader.py", line 37, in download
return pg.start()
^^^^^^^^^^
File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python312\Lib\site-packages\biliup\engine\download.py", line 379, in start
ret = self.run()
^^^^^^^^^^
File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python312\Lib\site-packages\biliup\engine\download.py", line 359, in run
retval = self.download()
^^^^^^^^^^^^^^^
File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python312\Lib\site-packages\biliup\engine\download.py", line 156, in download
stream_gears_download(self.raw_stream_url, self.stream_headers, self.gen_download_filename(),
File "C:\Users\Ninzore\AppData\Local\Programs\Python\Python312\Lib\site-packages\biliup\engine\download.py", line 557, in stream_gears_download
stream_gears.download_with_callback(
pyo3_runtime.PanicException: a Display implementation returned an error unexpectedly: Error
其他补充描述
关联问题 #1313
看了一下,
当使用基于ffmpeg的下载方式时,
time.strftime无法正确处理由%开头的非%Y,%m,%d,%H,%M,%S,导致输出文件名为空,发生在
https://github.com/biliup/biliup/blob/90bd1381c9c5afcebf0a953f4266d3cd3a592b8e/biliup/engine/download.py#L516
估计stream-gear那里有类似的错误