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 (IL50〜/90〜)</td>
|
|
<td>ノーマル / 真</td>
|
|
<td>エンキドゥとの共闘。ニワトリ化デバフ、カエル変化。</td>
|
|
<td>準備中</td>
|
|
</tr>"""
|
|
|
|
replacement = """ <tr>
|
|
<td><strong>ギルガメッシュ討伐戦 / 真ギルガメッシュ</strong></td>
|
|
<td>Lv50 (IL50〜/90〜)</td>
|
|
<td>ノーマル / 真</td>
|
|
<td>エンキドゥとの共闘。ニワトリ化デバフ、カエル変化。</td>
|
|
<td><a href="gilgamesh.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/gilgamesh.html', 'r', encoding='utf-8-sig') as f:
|
|
gil = f.read()
|
|
gil_lines = [line.rstrip() for line in gil.splitlines()]
|
|
gil_clean = '\r\n'.join(gil_lines) + '\r\n'
|
|
with open('trials/gilgamesh.html', 'wb') as f:
|
|
f.write(b'\xef\xbb\xbf' + gil_clean.encode('utf-8'))
|
|
|
|
print("ギルガメッシュのリンク更新および正規化が完了しました。")
|
|
|
|
if __name__ == '__main__':
|
|
main()
|