chore: リンク更新用スクリプトツールのコミット
This commit is contained in:
1 parent
cf35adc48d
commit
a653dcb5a6
122 files changed
+5826
No files matched your search
@@ -0,0 +1,43 @@
|
||||
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>Lv80 (IL440〜)</td>
|
||||
<td><strong>対応</strong></td>
|
||||
<td>パッチ5.2メインID。テンペスト深海施設。ルキア、キマイラ、床の排水溝塞ぎ。</td>
|
||||
<td>準備中</td>
|
||||
</tr>"""
|
||||
|
||||
replacement = """ <tr>
|
||||
<td><strong>黒風海底 アニドラス・アナムネーシス</strong></td>
|
||||
<td>Lv80 (IL440〜)</td>
|
||||
<td><strong>対応</strong></td>
|
||||
<td>パッチ5.2メインID。テンペスト深海施設。ルキア、キマイラ、床の排水溝塞ぎ。</td>
|
||||
<td><a href="anamesis_anyder.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/anamesis_anyder.html', 'r', encoding='utf-8-sig') as f:
|
||||
ana = f.read()
|
||||
ana_lines = [line.rstrip() for line in ana.splitlines()]
|
||||
ana_clean = '\r\n'.join(ana_lines) + '\r\n'
|
||||
with open('dungeons/anamesis_anyder.html', 'wb') as f:
|
||||
f.write(b'\xef\xbb\xbf' + ana_clean.encode('utf-8'))
|
||||
|
||||
print("黒風海底 アニドラス・アナムネーシスのリンク更新および正規化が完了しました。")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in new issue
Block a user