import sys def main(): with open('trials/index.html', 'r', encoding='utf-8-sig') as f: content = f.read() target = """ 絶オメガ検証戦 Lv90 (IL635シンク) 絶 (Ultimate) オメガ、オメガM/F、ファイナルオメガ、デュナミスオメガ。称号「The Alpha Legend」。 準備中 """ replacement = """ 絶オメガ検証戦 Lv90 (IL635シンク) 絶 (Ultimate) オメガ、オメガM/F、ファイナルオメガ、デュナミスオメガ。称号「The Alpha Legend」。 攻略を見る ➜ """ 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_omega.html', 'r', encoding='utf-8-sig') as f: top = f.read() top_lines = [line.rstrip() for line in top.splitlines()] top_clean = '\r\n'.join(top_lines) + '\r\n' with open('trials/ultimate_omega.html', 'wb') as f: f.write(b'\xef\xbb\xbf' + top_clean.encode('utf-8')) print("絶オメガ検証戦のリンク更新および正規化が完了しました。") if __name__ == '__main__': main()