import sys
def main():
with open('dungeons/index.html', 'r', encoding='utf-8-sig') as f:
content = f.read()
target = """
| 黄金平原 パガルザン |
Lv80 (IL490〜) |
対応 |
パッチ5.5メインID。アマルジャ族の平原。竜車突進、ルナバハムート。 |
準備中 |
"""
replacement = """
| 黄金平原 パガルザン |
Lv80 (IL490〜) |
対応 |
パッチ5.5メイン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/paglthan.html', 'r', encoding='utf-8-sig') as f:
pag = f.read()
pag_lines = [line.rstrip() for line in pag.splitlines()]
pag_clean = '\r\n'.join(pag_lines) + '\r\n'
with open('dungeons/paglthan.html', 'wb') as f:
f.write(b'\xef\xbb\xbf' + pag_clean.encode('utf-8'))
print("黄金平原 パガルザンのリンク更新および正規化が完了しました。")
if __name__ == '__main__':
main()