import sys
def main():
with open('dungeons/index.html', 'r', encoding='utf-8-sig') as f:
content = f.read()
target = """
| 楽園都市 スマイルトン |
Lv90 (IL540〜) |
非対応 |
レポリットの建設都市。スマイリー・フェイス、ビッグ・チーズの爆撃ライン。 |
準備中 |
"""
replacement = """
| 楽園都市 スマイルトン |
Lv90 (IL540〜) |
非対応 |
レポリットの建設都市。スマイリー・フェイス、ビッグ・チーズの爆撃ライン。 |
攻略を見る ➜ |
"""
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/smileton.html', 'r', encoding='utf-8-sig') as f:
smi = f.read()
smi_lines = [line.rstrip() for line in smi.splitlines()]
smi_clean = '\r\n'.join(smi_lines) + '\r\n'
with open('dungeons/smileton.html', 'wb') as f:
f.write(b'\xef\xbb\xbf' + smi_clean.encode('utf-8'))
print("楽園都市 スマイルトンのリンク更新および正規化が完了しました。")
if __name__ == '__main__':
main()