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>Lv70 (IL280〜)</td>
|
|
<td>非対応</td>
|
|
<td>反乱浪士の立てこもり。からくり人形、ヨウジンボウ(小判拾い)。</td>
|
|
<td>準備中</td>
|
|
</tr>"""
|
|
|
|
replacement = """ <tr>
|
|
<td><strong>悪党成敗 クガネ城</strong></td>
|
|
<td>Lv70 (IL280〜)</td>
|
|
<td>非対応</td>
|
|
<td>反乱浪士の立てこもり。からくり人形、ヨウジンボウ(小判拾い)。</td>
|
|
<td><a href="kugane_castle.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/kugane_castle.html', 'r', encoding='utf-8-sig') as f:
|
|
kug = f.read()
|
|
kug_lines = [line.rstrip() for line in kug.splitlines()]
|
|
kug_clean = '\r\n'.join(kug_lines) + '\r\n'
|
|
with open('dungeons/kugane_castle.html', 'wb') as f:
|
|
f.write(b'\xef\xbb\xbf' + kug_clean.encode('utf-8'))
|
|
|
|
print("悪党成敗 クガネ城のリンク更新および正規化が完了しました。")
|
|
|
|
if __name__ == '__main__':
|
|
main()
|