Skip to content

Commit

Permalink
🍱 补充一部分5.2的资源
Browse files Browse the repository at this point in the history
  • Loading branch information
KimigaiiWuyi committed Oct 11, 2024
1 parent e1ee855 commit 4c91a19
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
10 changes: 5 additions & 5 deletions GenshinUID/genshinuid_collection/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
}
'''

# 5.0影月月数据
# 5.2影月月数据
yyy_data = {
'成就': 1225,
'华丽的宝箱': 299,
'成就': 1270,
'华丽的宝箱': 300,
'珍贵的宝箱': 790,
'精致的宝箱': 2535,
'普通的宝箱': 3175,
'精致的宝箱': 2539,
'普通的宝箱': 3177,
'奇馈宝箱': 281,
'解锁传送点': 501,
'解锁秘境': 61,
Expand Down
26 changes: 19 additions & 7 deletions GenshinUID/tools/download_icon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
from io import BytesIO
from time import sleep
from typing import Dict
from pathlib import Path

Expand All @@ -13,8 +14,8 @@

suffix = 'webp'

char_list = ['Xilonen']
base = 'https://api.hakush.in/gi/UI/'
char_list = ['Chasca', 'Olorun']
base = 'https://api.hakush.in/gi/UI'
# title = 'https://enka.network/ui/{}'
# hakush = 'https://api.hakush.in/gi/UI/'
# ambr = 'https://gi.yatta.top/assets/UI'
Expand Down Expand Up @@ -51,7 +52,14 @@ def download(icon_name: str, url: str):
print(f'{icon_name}已经存在!,跳过!')
return
print(f'正在下载{icon_name}')
char_data = httpx.get(url, follow_redirects=True, timeout=80)
print(url)
while True:
try:
char_data = httpx.get(url, follow_redirects=True, timeout=80)
break
except: # noqa:E722
sleep(4)

if char_data.headers['Content-Type'] == 'image/png':
char_bytes = char_data.content
elif char_data.headers['Content-Type'] == 'image/webp':
Expand Down Expand Up @@ -86,10 +94,13 @@ def main():
download(icon_name, url)


def download_namecard_pic():
def download_namecard_pic(start: int = 10000002):
for _enname in enmap:
en = _enname.split(' ')[-1]
avatar_id = enmap[_enname]
if int(avatar_id) < start:
continue

if en == 'Jean':
en = 'Qin'
elif en == 'Baizhu':
Expand Down Expand Up @@ -118,9 +129,10 @@ def download_namecard_pic():
en = 'Hutao'
elif en == 'Thoma':
en = 'Tohma'
url = f'{base}/namecard/UI_NameCardPic_{en}_P.' + suffix
url = f'{base}/UI_NameCardPic_{en}_P.' + suffix
download(f'{avatar_id}.' + suffix, url)


# download_namecard_pic()
main()
if __name__ == '__main__':
# download_namecard_pic(10000063)
main()
10 changes: 10 additions & 0 deletions GenshinUID/utils/map/data/char_alias.json
Original file line number Diff line number Diff line change
Expand Up @@ -883,5 +883,15 @@
"西诺宁",
"豹女",
"希诺柠"
],
"恰斯卡": [
"恰斯卡",
"恰似卡",
"卡斯卡"
],
"欧洛伦": [
"欧洛仑",
"欧罗伦",
"欧罗伦"
]
}

0 comments on commit 4c91a19

Please sign in to comment.