import sys def main(): with open('trials/index.html', 'r', encoding='utf-8-sig') as f: content = f.read() target = """ 真ラムウ / 極ラムウ Lv50 (IL65〜/85〜) 真 / 極 (8人) 避雷針玉集め(タンク蓄電バフスイッチ)、カオスストライク解除。 準備中 """ replacement = """ 真ラムウ / 極ラムウ Lv50 (IL65〜/85〜) 真 / 極 (8人) 避雷針玉集め(タンク蓄電バフスイッチ)、カオスストライク解除。 攻略を見る ➜ """ 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/ramuh.html', 'r', encoding='utf-8-sig') as f: ramuh = f.read() ramuh_lines = [line.rstrip() for line in ramuh.splitlines()] ramuh_clean = '\r\n'.join(ramuh_lines) + '\r\n' with open('trials/ramuh.html', 'wb') as f: f.write(b'\xef\xbb\xbf' + ramuh_clean.encode('utf-8')) print("真ラムウのリンク更新および正規化が完了しました。") if __name__ == '__main__': main()