mirror of
https://github.com/earthjasonlin/zzz-signal-search-export.git
synced 2025-10-14 17:00:08 +08:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
43bfc906bd | ||
b496dd870c
|
|||
0c317f78b3
|
|||
|
f84a5282db | ||
66acb3e4dc
|
|||
b10a11b177
|
|||
db587f3537
|
|||
afb06390c0
|
|||
6b84fe8670
|
91
.github/workflows/idmap.yml
vendored
Normal file
91
.github/workflows/idmap.yml
vendored
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
name: Update ID Map and Version
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-idmap:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install requests opencc
|
||||||
|
|
||||||
|
- name: Run getIdMap.py
|
||||||
|
run: |
|
||||||
|
python tools/getIdMap.py
|
||||||
|
|
||||||
|
- name: Check if idJson.json changed
|
||||||
|
id: check_changes
|
||||||
|
run: |
|
||||||
|
git add -A
|
||||||
|
if git diff --staged --quiet -- src/idJson.json; then
|
||||||
|
echo "changes=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "No changes detected in src/idJson.json"
|
||||||
|
else
|
||||||
|
echo "changes=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "Changes detected in src/idJson.json"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Get current version from idJson
|
||||||
|
if: steps.check_changes.outputs.changes == 'true'
|
||||||
|
id: get_version
|
||||||
|
run: |
|
||||||
|
VERSION=$(python -c "import json; print(json.load(open('src/idJson.json', encoding='utf-8'))['version'])")
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "Current version in idJson: $VERSION"
|
||||||
|
|
||||||
|
- name: Bump package.json version
|
||||||
|
if: steps.check_changes.outputs.changes == 'true'
|
||||||
|
id: bump_version
|
||||||
|
run: |
|
||||||
|
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
||||||
|
echo "Current package.json version: $CURRENT_VERSION"
|
||||||
|
|
||||||
|
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
|
||||||
|
MAJOR=${VERSION_PARTS[0]}
|
||||||
|
MINOR=${VERSION_PARTS[1]}
|
||||||
|
PATCH=${VERSION_PARTS[2]}
|
||||||
|
|
||||||
|
NEW_PATCH=$((PATCH + 1))
|
||||||
|
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
|
||||||
|
|
||||||
|
echo "New package.json version: $NEW_VERSION"
|
||||||
|
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
node -e "
|
||||||
|
const fs = require('fs');
|
||||||
|
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
||||||
|
packageJson.version = '$NEW_VERSION';
|
||||||
|
fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2) + '\n');
|
||||||
|
"
|
||||||
|
|
||||||
|
- name: Create and push tag
|
||||||
|
if: steps.check_changes.outputs.changes == 'true'
|
||||||
|
run: |
|
||||||
|
git config --local user.email "action@github.com"
|
||||||
|
git config --local user.name "GitHub Action"
|
||||||
|
git add src/idJson.json package.json
|
||||||
|
git commit -m "chore: update idJson to ${{ steps.get_version.outputs.version }}"
|
||||||
|
|
||||||
|
TAG_NAME="v${{ steps.bump_version.outputs.new_version }}"
|
||||||
|
git tag $TAG_NAME
|
||||||
|
|
||||||
|
git push
|
||||||
|
git push origin $TAG_NAME
|
||||||
|
|
||||||
|
echo "Created and pushed tag: $TAG_NAME"
|
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
tag_name: ${{ github.ref }}
|
||||||
release_name: ZzzSignalSearchExport ${{ github.ref }}
|
release_name: ZzzSignalSearchExport ${{ github.ref }}
|
||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
id: upload-release-asset
|
id: upload-release-asset
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||||
asset_path: ./build/app.zip
|
asset_path: ./build/app.zip
|
||||||
@@ -52,4 +52,4 @@ jobs:
|
|||||||
commit_message: Update app
|
commit_message: Update app
|
||||||
build_dir: ./build/update
|
build_dir: ./build/update
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "zzz-signal-search-export",
|
"name": "zzz-signal-search-export",
|
||||||
"version": "1.1.11",
|
"version": "1.1.14",
|
||||||
"autoUpdateActive": true,
|
"autoUpdateActive": true,
|
||||||
"autoUpdateFrom": "1.1.0",
|
"autoUpdateFrom": "1.1.0",
|
||||||
"main": "./dist/electron/main/main.js",
|
"main": "./dist/electron/main/main.js",
|
||||||
|
@@ -101,7 +101,7 @@
|
|||||||
"excel.customFont": "Arial",
|
"excel.customFont": "Arial",
|
||||||
"excel.filePrefix": "Zenless Zone Zero Signal Search Log",
|
"excel.filePrefix": "Zenless Zone Zero Signal Search Log",
|
||||||
"excel.fileType": "Excel file",
|
"excel.fileType": "Excel file",
|
||||||
"uigf.fileType": "Uniformed Interchangeable GachaLog Format v4.0 (Beta)",
|
"uigf.fileType": "Uniformed Interchangeable GachaLog Format v4.0, v4.1",
|
||||||
"ui.extra.cacheClean": "1. Confirm whether the search history in the game has been opened, and if the error \"User authentication expired\" still appears, try the following steps \n2. Close the game window of Zenless Zone Zero \n3. Click the \"Open Web Cache Folder\" button above to open the \"Cache\" folder \n4. Delete the \"Cache_Data\" folder \n5. Start the Zenless Zone Zero game and open the search history page in the game \n6. Close this dialog and click the \"Update Data\" button",
|
"ui.extra.cacheClean": "1. Confirm whether the search history in the game has been opened, and if the error \"User authentication expired\" still appears, try the following steps \n2. Close the game window of Zenless Zone Zero \n3. Click the \"Open Web Cache Folder\" button above to open the \"Cache\" folder \n4. Delete the \"Cache_Data\" folder \n5. Start the Zenless Zone Zero game and open the search history page in the game \n6. Close this dialog and click the \"Update Data\" button",
|
||||||
"ui.extra.findCacheFolder": "If the \"Open cache folder\" button does not respond, you can manually find the game's web cache folder. The directory is \"Your game installation path/ZenlessZoneZero_Data/webCaches/Cache/\"",
|
"ui.extra.findCacheFolder": "If the \"Open cache folder\" button does not respond, you can manually find the game's web cache folder. The directory is \"Your game installation path/ZenlessZoneZero_Data/webCaches/Cache/\"",
|
||||||
"ui.extra.urlCopied": "URL Copied",
|
"ui.extra.urlCopied": "URL Copied",
|
||||||
|
@@ -100,7 +100,7 @@
|
|||||||
"excel.customFont": "微软雅黑",
|
"excel.customFont": "微软雅黑",
|
||||||
"excel.filePrefix": "绝区零调频记录",
|
"excel.filePrefix": "绝区零调频记录",
|
||||||
"excel.fileType": "Excel文件",
|
"excel.fileType": "Excel文件",
|
||||||
"uigf.fileType":"统一可交换抽卡记录标准 v4.0(Beta)",
|
"uigf.fileType":"统一可交换抽卡记录标准 v4.0, v4.1",
|
||||||
"ui.extra.cacheClean": "1. 确认是否已经打开游戏内的抽卡历史记录,如果仍然出现“身份认证已过期”的错误,再尝试下面的步骤\n2. 关闭绝区零的游戏窗口\n3. 点击上方的“打开缓存文件夹”按钮,打开Cache文件夹\n4. 删除Cache_Data文件夹\n5. 启动绝区零游戏,打开游戏内抽卡历史记录页面\n6. 关闭这个对话框,再点击“更新数据”按钮",
|
"ui.extra.cacheClean": "1. 确认是否已经打开游戏内的抽卡历史记录,如果仍然出现“身份认证已过期”的错误,再尝试下面的步骤\n2. 关闭绝区零的游戏窗口\n3. 点击上方的“打开缓存文件夹”按钮,打开Cache文件夹\n4. 删除Cache_Data文件夹\n5. 启动绝区零游戏,打开游戏内抽卡历史记录页面\n6. 关闭这个对话框,再点击“更新数据”按钮",
|
||||||
"ui.extra.findCacheFolder": "如果点“打开缓存文件夹”按钮没有反应,可以手动找到游戏的网页缓存文件夹,目录为“你的游戏安装路径/ZenlessZoneZero_Data/webCaches/Cache/”",
|
"ui.extra.findCacheFolder": "如果点“打开缓存文件夹”按钮没有反应,可以手动找到游戏的网页缓存文件夹,目录为“你的游戏安装路径/ZenlessZoneZero_Data/webCaches/Cache/”",
|
||||||
"ui.extra.urlCopied": "URL已复制",
|
"ui.extra.urlCopied": "URL已复制",
|
||||||
|
@@ -99,7 +99,7 @@
|
|||||||
"excel.customFont": "微軟雅黑",
|
"excel.customFont": "微軟雅黑",
|
||||||
"excel.filePrefix": "絕區零調頻記錄",
|
"excel.filePrefix": "絕區零調頻記錄",
|
||||||
"excel.fileType": "Excel文件",
|
"excel.fileType": "Excel文件",
|
||||||
"uigf.fileType":"統一可交換抽卡記錄標準 v4.0(Beta)",
|
"uigf.fileType":"統一可交換抽卡記錄標準 v4.0, v4.1",
|
||||||
"ui.extra.cacheClean": "1. 確認是否已經打開遊戲內的抽卡歷史記錄,如果仍然出現「身份認證已過期」的錯誤,再嘗試下面的步驟\n2. 關閉絕區零的遊戲窗口\n3. 點擊上方的「打開緩存文件夾」按鈕,打開Cache文件夾\n4. 刪除Cache_Data文件夾\n5. 啟動絕區零遊戲,打開遊戲內抽卡歷史記錄頁面\n6. 關閉這個對話框,再點擊「更新數據」按鈕",
|
"ui.extra.cacheClean": "1. 確認是否已經打開遊戲內的抽卡歷史記錄,如果仍然出現「身份認證已過期」的錯誤,再嘗試下面的步驟\n2. 關閉絕區零的遊戲窗口\n3. 點擊上方的「打開緩存文件夾」按鈕,打開Cache文件夾\n4. 刪除Cache_Data文件夾\n5. 啟動絕區零遊戲,打開遊戲內抽卡歷史記錄頁面\n6. 關閉這個對話框,再點擊「更新數據」按鈕",
|
||||||
"ui.extra.findCacheFolder": "如果點「打開緩存文件夾」按鈕沒有反應,可以手動找到遊戲的網頁緩存文件夾,目錄為「你的遊戲安裝路徑/ZenlessZoneZero_Data/webCaches/Cache/」",
|
"ui.extra.findCacheFolder": "如果點「打開緩存文件夾」按鈕沒有反應,可以手動找到遊戲的網頁緩存文件夾,目錄為「你的遊戲安裝路徑/ZenlessZoneZero_Data/webCaches/Cache/」",
|
||||||
"ui.extra.urlCopied": "URL已復製",
|
"ui.extra.urlCopied": "URL已復製",
|
||||||
|
991
src/idJson.json
991
src/idJson.json
File diff suppressed because it is too large
Load Diff
@@ -92,7 +92,7 @@ const importUIGF = async () => {
|
|||||||
try {
|
try {
|
||||||
const jsonData = fs.readJsonSync(filepath[0])
|
const jsonData = fs.readJsonSync(filepath[0])
|
||||||
if('info' in jsonData && 'version' in jsonData.info) {
|
if('info' in jsonData && 'version' in jsonData.info) {
|
||||||
if (jsonData.info.version !== 'v4.0') {
|
if (jsonData.info.version !== 'v4.0' && jsonData.info.version !== 'v4.1') {
|
||||||
sendMsg('不支持此版本UIGF')
|
sendMsg('不支持此版本UIGF')
|
||||||
console.error('不支持此版本UIGF')
|
console.error('不支持此版本UIGF')
|
||||||
return
|
return
|
||||||
|
@@ -6,13 +6,7 @@ import requests
|
|||||||
from opencc import OpenCC
|
from opencc import OpenCC
|
||||||
|
|
||||||
# 初始化 OpenCC 转换器
|
# 初始化 OpenCC 转换器
|
||||||
cc = OpenCC('s2t')
|
cc = OpenCC("s2t")
|
||||||
|
|
||||||
# 获取 JSON 数据
|
|
||||||
weapon_url = 'https://api.hakush.in/zzz/data/weapon.json'
|
|
||||||
character_url = 'https://api.hakush.in/zzz/data/character.json'
|
|
||||||
bangboo_url = 'https://api.hakush.in/zzz/data/bangboo.json'
|
|
||||||
version_url = 'https://api.hakush.in/zzz/new.json'
|
|
||||||
|
|
||||||
# 语言映射配置
|
# 语言映射配置
|
||||||
language_map = {
|
language_map = {
|
||||||
@@ -20,45 +14,76 @@ language_map = {
|
|||||||
"zh-tw": "CHS", # 简体转繁体
|
"zh-tw": "CHS", # 简体转繁体
|
||||||
"en-us": "EN",
|
"en-us": "EN",
|
||||||
"ja-jp": "JA",
|
"ja-jp": "JA",
|
||||||
"ko-kr": "KO"
|
"ko-kr": "KO",
|
||||||
}
|
}
|
||||||
|
|
||||||
# 类型映射配置
|
# 类型映射配置
|
||||||
type_map = {
|
type_map = {
|
||||||
"weapon": {"zh-cn": "音擎", "zh-tw": "音擎", "en-us": "W-Engines", "ja-jp": "音動機", "ko-kr": "W-엔진"},
|
"weapon": {
|
||||||
"character": {"zh-cn": "代理人", "zh-tw": "代理人", "en-us": "Agents",
|
"zh-cn": "音擎",
|
||||||
"ja-jp": "エージェント", "ko-kr": "에이전트"},
|
"zh-tw": "音擎",
|
||||||
"bangboo": {"zh-cn": "邦布", "zh-tw": "邦布", "en-us": "Bangboo",
|
"en-us": "W-Engines",
|
||||||
"ja-jp": "ボンプ", "ko-kr": "「Bangboo」"}
|
"ja-jp": "音動機",
|
||||||
|
"ko-kr": "W-엔진",
|
||||||
|
},
|
||||||
|
"character": {
|
||||||
|
"zh-cn": "代理人",
|
||||||
|
"zh-tw": "代理人",
|
||||||
|
"en-us": "Agents",
|
||||||
|
"ja-jp": "エージェント",
|
||||||
|
"ko-kr": "에이전트",
|
||||||
|
},
|
||||||
|
"bangboo": {
|
||||||
|
"zh-cn": "邦布",
|
||||||
|
"zh-tw": "邦布",
|
||||||
|
"en-us": "Bangboo",
|
||||||
|
"ja-jp": "ボンプ",
|
||||||
|
"ko-kr": "「Bangboo」",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def fetch_json(url):
|
def fetch_json(url):
|
||||||
response = requests.get(url, timeout=10)
|
response = requests.get(url, timeout=10)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
|
|
||||||
def transform_data(data, item_type):
|
def transform_data(data, item_type):
|
||||||
transformed = {lang: {} for lang in language_map.keys()}
|
transformed = {lang: {} for lang in language_map.keys()}
|
||||||
for id_, item in data.items():
|
for id_, item in data.items():
|
||||||
for lang, key in language_map.items():
|
for lang, key in language_map.items():
|
||||||
name = item[key] if lang != 'zh-tw' else cc.convert(item['CHS'])
|
name = item[key] if lang != "zh-tw" else cc.convert(item["CHS"])
|
||||||
transformed[lang][id_] = {
|
transformed[lang][id_] = {
|
||||||
"name": name,
|
"name": name,
|
||||||
"item_type": type_map[item_type][lang],
|
"item_type": type_map[item_type][lang],
|
||||||
"rank_type": item['rank']
|
"rank_type": item["rank"],
|
||||||
}
|
}
|
||||||
return transformed
|
return transformed
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
weapon_data = fetch_json(weapon_url)
|
version_url = "https://api.hakush.in/zzz/new.json"
|
||||||
character_data = fetch_json(character_url)
|
|
||||||
bangboo_data = fetch_json(bangboo_url)
|
|
||||||
version_data = fetch_json(version_url)
|
version_data = fetch_json(version_url)
|
||||||
|
|
||||||
|
latest_version = ".".join(version_data["version"].split(".")[:2]) + ".0"
|
||||||
|
print(f"Latest version: {latest_version}")
|
||||||
|
|
||||||
|
weapon_url = f"https://api.hakush.in/zzz/{latest_version}/weapon.json"
|
||||||
|
character_url = f"https://api.hakush.in/zzz/{latest_version}/character.json"
|
||||||
|
bangboo_url = f"https://api.hakush.in/zzz/{latest_version}/bangboo.json"
|
||||||
|
|
||||||
|
weapon_data = fetch_json(weapon_url)
|
||||||
|
print("Fetched", len(weapon_data), "weapons")
|
||||||
|
character_data = fetch_json(character_url)
|
||||||
|
print("Fetched", len(character_data), "characters")
|
||||||
|
bangboo_data = fetch_json(bangboo_url)
|
||||||
|
print("Fetched", len(bangboo_data), "bangboos")
|
||||||
|
|
||||||
transformed_data = {lang: {} for lang in language_map.keys()}
|
transformed_data = {lang: {} for lang in language_map.keys()}
|
||||||
|
|
||||||
transformed_data["version"] = version_data["version"]
|
transformed_data["version"] = latest_version
|
||||||
|
|
||||||
weapon_transformed = transform_data(weapon_data, "weapon")
|
weapon_transformed = transform_data(weapon_data, "weapon")
|
||||||
character_transformed = transform_data(character_data, "character")
|
character_transformed = transform_data(character_data, "character")
|
||||||
@@ -69,7 +94,7 @@ def main():
|
|||||||
transformed_data[lang].update(character_transformed[lang])
|
transformed_data[lang].update(character_transformed[lang])
|
||||||
transformed_data[lang].update(bangboo_transformed[lang])
|
transformed_data[lang].update(bangboo_transformed[lang])
|
||||||
|
|
||||||
with open('./src/idJson.json', 'w', encoding='utf-8') as f:
|
with open("./src/idJson.json", "w", encoding="utf-8") as f:
|
||||||
json.dump(transformed_data, f, ensure_ascii=False, indent=2)
|
json.dump(transformed_data, f, ensure_ascii=False, indent=2)
|
||||||
|
|
||||||
print("Data successfully transformed and saved")
|
print("Data successfully transformed and saved")
|
||||||
@@ -77,5 +102,6 @@ def main():
|
|||||||
except requests.RequestException as e:
|
except requests.RequestException as e:
|
||||||
print(f"Error fetching data: {e}")
|
print(f"Error fetching data: {e}")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
Reference in New Issue
Block a user