We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ba01d7 commit a08c51cCopy full SHA for a08c51c
ui/main_window.py
@@ -79,7 +79,9 @@ def _on_conversion_finished(self, result):
79
80
# 生成文件名 (使用前20个字符作为文件名)
81
text = self.conversion_panel.text_input.toPlainText()[:20]
82
- filename = f"{text}_{int(time.time())}.{self.conversion_panel.format_combo.currentText()}"
+ # 文件名去掉换行符,逗号,引号,感叹号,问号等等特殊字符,仅保留汉字和字母及下划线
83
+ filename = re.sub(r'[^\u4e00-\u9fa5a-zA-Z0-9_]', '', text)
84
+ filename = f"{filename}_{int(time.time())}.{self.conversion_panel.format_combo.currentText()}"
85
86
# 保存音频文件
87
filepath = self.core.audio_mgr.save_audio(result, filename, output_dir)
0 commit comments