import sys def main(): with open('trials/index.html', 'r', encoding='utf-8-sig') as f: content = f.read() target = """ 絶もうひとつの未来 Lv100 (IL710シンク) 絶 (Ultimate) 【パッチ7.1最新絶】 エデン共鳴編・再生編ifストーリー。光の巫女と闇の巫女。 準備中 """ replacement = """ 絶もうひとつの未来 Lv100 (IL710シンク) 絶 (Ultimate) 【パッチ7.1最新絶】 エデン共鳴編・再生編ifストーリー。光の巫女と闇の巫女。 攻略を見る ➜ """ if target not in content: print("エラー: ターゲット文字列が見つかりません") sys.exit(1) content = content.replace(target, replacement) lines = [line.rstrip() for line in content.splitlines()] content_clean = '\r\n'.join(lines) + '\r\n' with open('trials/index.html', 'wb') as f: f.write(b'\xef\xbb\xbf' + content_clean.encode('utf-8')) with open('trials/ultimate_eden.html', 'r', encoding='utf-8-sig') as f: eden = f.read() eden_lines = [line.rstrip() for line in eden.splitlines()] eden_clean = '\r\n'.join(eden_lines) + '\r\n' with open('trials/ultimate_eden.html', 'wb') as f: f.write(b'\xef\xbb\xbf' + eden_clean.encode('utf-8')) print("絶もうひとつの未来のリンク更新および正規化が完了しました。") if __name__ == '__main__': main()