feat: 濁流遡上 イフイカ・トゥム 完全攻略ページの作成およびリンク追加
This commit is contained in:
1 parent
451fece930
commit
049dd830e5
5 files changed
+303
-28
No files matched your search
+15
-27
@@ -22,51 +22,39 @@ def clean_and_save(path, content):
|
||||
with open(path, 'wb') as f:
|
||||
f.write(b'\xef\xbb\xbf' + text.encode('utf-8'))
|
||||
|
||||
def update_raid_lh4():
|
||||
# 1. raids/index.html
|
||||
path_idx = 'raids/index.html'
|
||||
def update_ihuykatumu():
|
||||
# 1. dungeons/index.html
|
||||
path_idx = 'dungeons/index.html'
|
||||
with open(path_idx, 'rb') as f:
|
||||
c = f.read().decode('utf-8', errors='ignore')
|
||||
if 'arcadia_lh4.html' not in c:
|
||||
if 'href="ihuykatumu.html"' not in c:
|
||||
c = c.replace('\r\n', '\n')
|
||||
target = '<td><a href="arcadia_lh3.html">攻略を見る ➜</a></td>\n </tr>'
|
||||
new_row = '''<td><a href="arcadia_lh3.html">攻略を見る ➜</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>至天の座 アルカディア:<br>ライトヘビー級4層</strong></td>
|
||||
<td>Lv100 (パッチ7.x最新)</td>
|
||||
<td><strong>【最新ノーマルレイド】</strong> ボス「ウィケッドサンダー」。ウィッチハント、エレクトロープ展開、床破壊。</td>
|
||||
<td><a href="arcadia_lh4.html">攻略を見る ➜</a></td>
|
||||
</tr>'''
|
||||
if target in c:
|
||||
c = c.replace(target, new_row)
|
||||
else:
|
||||
c = re.sub(r'(<td><a href="arcadia_lh3\.html">.*?</td>\s*</tr>)', r'\1\n <tr>\n <td><strong>至天の座 アルカディア:<br>ライトヘビー級4層</strong></td>\n <td>Lv100 (パッチ7.x最新)</td>\n <td><strong>【最新ノーマルレイド】</strong> ボス「ウィケッドサンダー」。ウィッチハント、エレクトロープ展開、床破壊。</td>\n <td><a href="arcadia_lh4.html">攻略を見る ➜</a></td>\n </tr>', c)
|
||||
c = re.sub(r'(イフイカ・トゥム</strong>.*?<td>)準備中(</td>)', r'\1<a href="ihuykatumu.html">攻略を見る ➜</a>\2', c, flags=re.DOTALL)
|
||||
clean_and_save(path_idx, c)
|
||||
print("Updated raids/index.html")
|
||||
print("Updated ihuykatumu in dungeons/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="../raids/arcadia_lh4.html">アルカディア LH4層 (Lv100)</a></li>'
|
||||
new_sb = '<li><a href="../dungeons/ihuykatumu.html">イフイカ・トゥム (Lv91)</a></li>'
|
||||
if new_sb not in c:
|
||||
c = c.replace('\r\n', '\n')
|
||||
c = re.sub(r'(<li><a href="\.\./raids/arcadia_lh3\.html">.*?</li>)', r'\1\n ' + new_sb, c)
|
||||
c = re.sub(r'(<li><a href="\.\./dungeons/tender_valley\.html">.*?</li>)', r'\1\n ' + new_sb, c)
|
||||
clean_and_save(path_sb, c)
|
||||
print("Updated common/sidebar.html")
|
||||
print("Added ihuykatumu to 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: 'アルカディア LH4層 (Lv100)', path: 'raids/arcadia_lh4.html' }"
|
||||
if 'arcadia_lh4.html' not in c:
|
||||
new_js = "{ text: 'イフイカ・トゥム (Lv91)', path: 'dungeons/ihuykatumu.html' }"
|
||||
if 'ihuykatumu.html' not in c:
|
||||
c = c.replace('\r\n', '\n')
|
||||
c = re.sub(r"(\{ text: 'アルカディア LH3層 \(Lv100\)', path: 'raids/arcadia_lh3\.html' \})", r"\1,\n " + new_js, c)
|
||||
c = re.sub(r"(\{ text: 'サボテンダーバレー \(Lv100\)', path: 'dungeons/tender_valley\.html' \})", r"\1,\n " + new_js, c)
|
||||
clean_and_save(path_js, c)
|
||||
print("Updated common/js/wiki_common.js")
|
||||
print("Added ihuykatumu to common/js/wiki_common.js")
|
||||
|
||||
if __name__ == '__main__':
|
||||
clean_and_save('raids/arcadia_lh4.html', open('raids/arcadia_lh4.html', 'r', encoding='utf-8', errors='ignore').read())
|
||||
update_raid_lh4()
|
||||
clean_and_save('dungeons/ihuykatumu.html', open('dungeons/ihuykatumu.html', 'r', encoding='utf-8', errors='ignore').read())
|
||||
update_ihuykatumu()
|
||||
Reference in new issue
Block a user