feat: 至天の座 アルカディア: ライトヘビー級2層 完全攻略ページの作成およびリンク追加

This commit is contained in:
armonica committed 2026-10-29 11:32:50 +09:00
1 parent 2e15431ff1
commit ea90e9a8e0
5 files changed
+270 -19

No files matched your search

+28 -19
View File
@@ -22,42 +22,51 @@ def clean_and_save(path, content):
with open(path, 'wb') as f:
f.write(b'\xef\xbb\xbf' + text.encode('utf-8'))
def update_tender_valley():
# 1. dungeons/index.html
path_idx = 'dungeons/index.html'
def update_raid_lh2():
# 1. raids/index.html
path_idx = 'raids/index.html'
with open(path_idx, 'rb') as f:
c = f.read().decode('utf-8', errors='ignore')
if 'href="tender_valley.html"' not in c:
c = c.replace('<td><strong>荒野秘境 サボテンダーバレー</strong></td>\r\n\r\n <td>Lv100 (IL690〜)</td>\r\n\r\n <td>黄金サブクエスト開放ID。砂漠と遺跡を舞台にした最新高難易度エキスパートID。</td>\r\n\r\n <td><a href="alexandria.html">攻略を見る ➜</a></td>',
'<td><strong>荒野秘境 サボテンダーバレー</strong></td>\r\n <td>Lv100 (IL690〜)</td>\r\n <td>黄金サブクエスト開放ID。砂漠と遺跡を舞台にした最新高難易度エキスパートID。</td>\r\n <td><a href="tender_valley.html">攻略を見る ➜</a></td>')
c = c.replace('<td><strong>荒野秘境 サボテンダーバレー</strong></td>\n\n <td>Lv100 (IL690〜)</td>\n\n <td>黄金サブクエスト開放ID。砂漠と遺跡を舞台にした最新高難易度エキスパートID。</td>\n\n <td><a href="alexandria.html">攻略を見る ➜</a></td>',
'<td><strong>荒野秘境 サボテンダーバレー</strong></td>\n <td>Lv100 (IL690〜)</td>\n <td>黄金サブクエスト開放ID。砂漠と遺跡を舞台にした最新高難易度エキスパートID。</td>\n <td><a href="tender_valley.html">攻略を見る ➜</a></td>')
c = re.sub(r'(サボテンダーバレー</strong>.*?<td>)<a href="alexandria\.html">', r'\1<a href="tender_valley.html">', c, flags=re.DOTALL)
if 'arcadia_lh2.html' not in c:
c = c.replace('\r\n', '\n')
target = '<td><a href="arcadia_lh1.html">攻略を見る ➜</a></td>\n </tr>'
new_row = '''<td><a href="arcadia_lh1.html">攻略を見る ➜</a></td>
</tr>
<tr>
<td><strong>至天の座 アルカディア:<br>ライトヘビー級2層</strong></td>
<td>Lv100 (パッチ7.x最新)</td>
<td><strong>【最新ノーマルレイド】</strong> ボス「ハニー・B・ラブリー」。ハートスタック管理、塔踏み、アラモード。</td>
<td><a href="arcadia_lh2.html">攻略を見る ➜</a></td>
</tr>'''
if target in c:
c = c.replace(target, new_row)
else:
c = re.sub(r'(<td><a href="arcadia_lh1\.html">.*?</td>\s*</tr>)', r'\1\n <tr>\n <td><strong>至天の座 アルカディア:<br>ライトヘビー級2層</strong></td>\n <td>Lv100 (パッチ7.x最新)</td>\n <td><strong>【最新ノーマルレイド】</strong> ボス「ハニー・B・ラブリー」。ハートスタック管理、塔踏み、アラモード。</td>\n <td><a href="arcadia_lh2.html">攻略を見る ➜</a></td>\n </tr>', c)
clean_and_save(path_idx, c)
print("Updated tender_valley in dungeons/index.html")
print("Updated raids/index.html")
# 2. common/sidebar.html
path_sb = 'common/sidebar.html'
with open(path_sb, 'rb') as f:
c = f.read().decode('utf-8', errors='ignore')
new_sb = '<li><a href="../dungeons/tender_valley.html">サボテンダーバレー (Lv100)</a></li>'
new_sb = '<li><a href="../raids/arcadia_lh2.html">アルカディア LH2層 (Lv100)</a></li>'
if new_sb not in c:
c = c.replace('\r\n', '\n')
c = re.sub(r'(<li><a href="\.\./dungeons/alexandria\.html">.*?</li>)', r'\1\n ' + new_sb, c)
c = re.sub(r'(<li><a href="\.\./raids/arcadia_lh1\.html">.*?</li>)', r'\1\n ' + new_sb, c)
clean_and_save(path_sb, c)
print("Added tender_valley to common/sidebar.html")
print("Updated common/sidebar.html")
# 3. common/js/wiki_common.js
path_js = 'common/js/wiki_common.js'
with open(path_js, 'rb') as f:
c = f.read().decode('utf-8', errors='ignore')
new_js = "{ text: 'サボテンダーバレー (Lv100)', path: 'dungeons/tender_valley.html' }"
if 'tender_valley.html' not in c:
new_js = "{ text: 'アルカディア LH2層 (Lv100)', path: 'raids/arcadia_lh2.html' }"
if 'arcadia_lh2.html' not in c:
c = c.replace('\r\n', '\n')
c = re.sub(r"(\{ text: '記憶幻想 アレクサンドリア \(Lv100\)', path: 'dungeons/alexandria\.html' \})", r"\1,\n " + new_js, c)
c = re.sub(r"(\{ text: 'アルカディア LH1層 \(Lv100\)', path: 'raids/arcadia_lh1\.html' \})", r"\1,\n " + new_js, c)
clean_and_save(path_js, c)
print("Added tender_valley to common/js/wiki_common.js")
print("Updated common/js/wiki_common.js")
if __name__ == '__main__':
clean_and_save('dungeons/tender_valley.html', open('dungeons/tender_valley.html', 'r', encoding='utf-8', errors='ignore').read())
update_tender_valley()
clean_and_save('raids/arcadia_lh2.html', open('raids/arcadia_lh2.html', 'r', encoding='utf-8', errors='ignore').read())
update_raid_lh2()