44 lines
1.7 KiB
Python
44 lines
1.7 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 (IL60〜/80〜)</td>
|
|
<td>真 / 極 (8人)</td>
|
|
<td>船体傾斜(柵破壊・落下死)、水神のヴェール、サハギン増援。</td>
|
|
<td>準備中</td>
|
|
</tr>"""
|
|
|
|
replacement = """ <tr>
|
|
<td><strong>真リヴァイアサン / 極リヴァイアサン</strong></td>
|
|
<td>Lv50 (IL60〜/80〜)</td>
|
|
<td>真 / 極 (8人)</td>
|
|
<td>船体傾斜(柵破壊・落下死)、水神のヴェール、サハギン増援。</td>
|
|
<td><a href="leviathan.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/leviathan.html', 'r', encoding='utf-8-sig') as f:
|
|
levi = f.read()
|
|
levi_lines = [line.rstrip() for line in levi.splitlines()]
|
|
levi_clean = '\r\n'.join(levi_lines) + '\r\n'
|
|
with open('trials/leviathan.html', 'wb') as f:
|
|
f.write(b'\xef\xbb\xbf' + levi_clean.encode('utf-8'))
|
|
|
|
print("真リヴァイアサンのリンク更新および正規化が完了しました。")
|
|
|
|
if __name__ == '__main__':
|
|
main()
|