44 lines
1.7 KiB
Python
44 lines
1.7 KiB
Python
import sys
|
|
|
|
def main():
|
|
with open('dungeons/index.html', 'r', encoding='utf-8-sig') as f:
|
|
content = f.read()
|
|
|
|
target = """ <tr>
|
|
<td><strong>楽園都市 スマイルトン</strong></td>
|
|
<td>Lv90 (IL540〜)</td>
|
|
<td>非対応</td>
|
|
<td>レポリットの建設都市。スマイリー・フェイス、ビッグ・チーズの爆撃ライン。</td>
|
|
<td>準備中</td>
|
|
</tr>"""
|
|
|
|
replacement = """ <tr>
|
|
<td><strong>楽園都市 スマイルトン</strong></td>
|
|
<td>Lv90 (IL540〜)</td>
|
|
<td>非対応</td>
|
|
<td>レポリットの建設都市。スマイリー・フェイス、ビッグ・チーズの爆撃ライン。</td>
|
|
<td><a href="smileton.html">攻略を見る ➜</a></td>
|
|
</tr>"""
|
|
|
|
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()
|