Commit 51c7615
Changed files (1)
src
others
src/others/subtitle.py
@@ -61,7 +61,7 @@ async def get_subtitle(client: Client, message: Message, youtube_subtitle_provid
caption = f"🔴[{vinfo['author']}]({vinfo['channel']})\n🕒{vinfo['date']:%Y-%m-%d %H:%M:%S}\n"
caption += f"📝[{vinfo['title']}]({yt_url})\n字符数: {res['num_chars']}\n阅读时长: {res['reading_minutes']:.1f}分钟"
with io.BytesIO(subtitles.encode("utf-8")) as f:
- await client.send_document(to_int(target_chat), f, file_name="字幕文件.txt", caption=caption)
+ await client.send_document(to_int(target_chat), f, file_name=f"{vinfo['title']}.txt", caption=caption)
else:
caption = f"原视频: [{vid}]({yt_url})\n字符数: {res['num_chars']}\n阅读时长: {res['reading_minutes']:.1f}分钟"
with io.BytesIO(subtitles.encode("utf-8")) as f: