import sys def main(): with open('dungeons/index.html', 'r', encoding='utf-8-sig') as f: content = f.read() target = """ 壊神修行 星導山寺院 Lv70 (IL280〜) 非対応 モンク総本山。クァール石像、ラールガーの試練。 準備中 """ replacement = """ 壊神修行 星導山寺院 Lv70 (IL280〜) 非対応 モンク総本山。クァール石像、ラールガーの試練。 攻略を見る ➜ """ 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('dungeons/index.html', 'wb') as f: f.write(b'\xef\xbb\xbf' + content_clean.encode('utf-8')) with open('dungeons/temple_of_the_fist.html', 'r', encoding='utf-8-sig') as f: tem = f.read() tem_lines = [line.rstrip() for line in tem.splitlines()] tem_clean = '\r\n'.join(tem_lines) + '\r\n' with open('dungeons/temple_of_the_fist.html', 'wb') as f: f.write(b'\xef\xbb\xbf' + tem_clean.encode('utf-8')) print("壊神修行 星導山寺院のリンク更新および正規化が完了しました。") if __name__ == '__main__': main()