from pathlib import Path html = r''' 字幕時間戳記清除小幫手
字幕清理工作室
SUBTITLE CLEANER

把字幕時間軸,
變成乾淨文字!

匯入 SRT、VTT 或 ASS 字幕檔,一鍵移除時間戳記與字幕序號。也可以直接貼上字幕內容,整理後下載成純文字檔。

📂 1. 匯入字幕

🎬

把字幕檔拖曳到這裡

支援 .srt、.vtt、.ass、.ssa、.txt

尚未選擇檔案

📝 2. 字幕內容與清除設定

✨ 3. 清理結果

0字元
0行文字
0個時間戳記已移除
''' path = Path("/mnt/data/subtitle_cleaner.html") path.write_text(html, encoding="utf-8") # Verify the exact file exists, is readable, and is a complete HTML document. check = path.read_text(encoding="utf-8") assert check.startswith("") and "" in check and len(check) == len(html) print(f"已成功建立並驗證:{path.name}({len(check):,} 個字元)")