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 (IL410〜)</td>
|
||||
<td>非対応</td>
|
||||
<td>「Long Fall」の大人気BGM。アラグのハイテク防衛、タイクーン。</td>
|
||||
<td>準備中</td>
|
||||
</tr>"""
|
||||
|
||||
replacement = """ <tr>
|
||||
<td><strong>異界遺構 シルクス・ツイニング</strong></td>
|
||||
<td>Lv80 (IL410〜)</td>
|
||||
<td>非対応</td>
|
||||
<td>「Long Fall」の大人気BGM。アラグのハイテク防衛、タイクーン。</td>
|
||||
<td><a href="twinning.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/twinning.html', 'r', encoding='utf-8-sig') as f:
|
||||
twi = f.read()
|
||||
twi_lines = [line.rstrip() for line in twi.splitlines()]
|
||||
twi_clean = '\r\n'.join(twi_lines) + '\r\n'
|
||||
with open('dungeons/twinning.html', 'wb') as f:
|
||||
f.write(b'\xef\xbb\xbf' + twi_clean.encode('utf-8'))
|
||||
|
||||
print("異界遺構 シルクス・ツイニングのリンク更新および正規化が完了しました。")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in new issue
Block a user