import sys
def main():
with open('dungeons/index.html', 'r', encoding='utf-8-sig') as f:
content = f.read()
target = """
| 魔術工房 マトーヤの洞窟 |
Lv80 (IL470〜) |
対応 |
パッチ5.4メインID。巨大カエル、泥団子転がし、使い魔マザーポークシー。 |
準備中 |
"""
replacement = """
| 魔術工房 マトーヤの洞窟 |
Lv80 (IL470〜) |
対応 |
パッチ5.4メインID。巨大カエル、泥団子転がし、使い魔マザーポークシー。 |
攻略を見る ➜ |
"""
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/matoyas_relict.html', 'r', encoding='utf-8-sig') as f:
mat = f.read()
mat_lines = [line.rstrip() for line in mat.splitlines()]
mat_clean = '\r\n'.join(mat_lines) + '\r\n'
with open('dungeons/matoyas_relict.html', 'wb') as f:
f.write(b'\xef\xbb\xbf' + mat_clean.encode('utf-8'))
print("魔術工房 マトーヤの洞窟のリンク更新および正規化が完了しました。")
if __name__ == '__main__':
main()