import sys
def main():
with open('dungeons/index.html', 'r', encoding='utf-8-sig') as f:
content = f.read()
target = """
| 海底宮殿 紫水宮 |
Lv63 (IL245〜) |
対応 |
紅玉海の竜宮城。玉手箱でおじいさん化して大技回避、紫水妖女。 |
準備中 |
"""
replacement = """
| 海底宮殿 紫水宮 |
Lv63 (IL245〜) |
対応 |
紅玉海の竜宮城。玉手箱でおじいさん化して大技回避、紫水妖女。 |
攻略を見る ➜ |
"""
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/shisui.html', 'r', encoding='utf-8-sig') as f:
shi = f.read()
shi_lines = [line.rstrip() for line in shi.splitlines()]
shi_clean = '\r\n'.join(shi_lines) + '\r\n'
with open('dungeons/shisui.html', 'wb') as f:
f.write(b'\xef\xbb\xbf' + shi_clean.encode('utf-8'))
print("海底宮殿 紫水宮のリンク更新および正規化が完了しました。")
if __name__ == '__main__':
main()