Files

44 lines
1.6 KiB
Python

import sys
def main():
with open('trials/index.html', 'r', encoding='utf-8-sig') as f:
content = f.read()
target = """ <tr>
<td><strong>闘神オーディン討伐戦</strong></td>
<td>Lv50 (IL95〜)</td>
<td>ノーマル (8人)</td>
<td>サンゲタル強攻撃、ヴァルクヌート、時間切れ真・斬鉄剣。</td>
<td>準備中</td>
</tr>"""
replacement = """ <tr>
<td><strong>闘神オーディン討伐戦</strong></td>
<td>Lv50 (IL95〜)</td>
<td>ノーマル (8人)</td>
<td>サンゲタル強攻撃、ヴァルクヌート、時間切れ真・斬鉄剣。</td>
<td><a href="odin.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('trials/index.html', 'wb') as f:
f.write(b'\xef\xbb\xbf' + content_clean.encode('utf-8'))
with open('trials/odin.html', 'r', encoding='utf-8-sig') as f:
odin = f.read()
odin_lines = [line.rstrip() for line in odin.splitlines()]
odin_clean = '\r\n'.join(odin_lines) + '\r\n'
with open('trials/odin.html', 'wb') as f:
f.write(b'\xef\xbb\xbf' + odin_clean.encode('utf-8'))
print("闘神オーディンのリンク更新および正規化が完了しました。")
if __name__ == '__main__':
main()