mirror of
https://github.com/earthjasonlin/zzz-signal-search-export.git
synced 2025-10-14 17:00:08 +08:00
Compare commits
22 Commits
5dec6a8273
...
v1.1.13
Author | SHA1 | Date | |
---|---|---|---|
|
f84a5282db | ||
66acb3e4dc
|
|||
b10a11b177
|
|||
db587f3537
|
|||
afb06390c0
|
|||
6b84fe8670
|
|||
e74f561ce5
|
|||
9738b41372
|
|||
2d0a5d38bb
|
|||
16e01b7a13
|
|||
8f492376a0
|
|||
0642c52db2
|
|||
af256fba7d
|
|||
6599fbe6d3
|
|||
a99959e6e5
|
|||
c9c92da926
|
|||
fcff120657
|
|||
0ec7cb7c4f
|
|||
5a3159d4cb
|
|||
38b99bf4dc
|
|||
0cd9c071d7
|
|||
bf582d0194
|
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 }}
|
@@ -36,6 +36,10 @@
|
|||||||
|
|
||||||
然后游戏切换的新账号,再打开调频历史记录,工具再点击“加载数据”按钮。
|
然后游戏切换的新账号,再打开调频历史记录,工具再点击“加载数据”按钮。
|
||||||
|
|
||||||
|
## Stargazers over time
|
||||||
|
|
||||||
|
[](https://starchart.cc/earthjasonlin/zzz-signal-search-export)
|
||||||
|
|
||||||
## Devlopment
|
## Devlopment
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "zzz-signal-search-export",
|
"name": "zzz-signal-search-export",
|
||||||
"version": "1.1.4",
|
"version": "1.1.13",
|
||||||
"autoUpdateActive": true,
|
"autoUpdateActive": true,
|
||||||
"autoUpdateFrom": "1.1.0",
|
"autoUpdateFrom": "1.1.0",
|
||||||
"main": "./dist/electron/main/main.js",
|
"main": "./dist/electron/main/main.js",
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
"tailwindcss": "^3.0.16",
|
"tailwindcss": "^3.0.16",
|
||||||
"vite": "2.7.13",
|
"vite": "2.7.13",
|
||||||
"vue": "^3.2.29",
|
"vue": "^3.2.29",
|
||||||
"winreg": "^1.2.4",
|
"winreg": "1.2.4",
|
||||||
"yauzl": "^2.10.0"
|
"yauzl": "^2.10.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
"ui.button.load": "Load data",
|
"ui.button.load": "Load data",
|
||||||
"ui.button.update": "Update",
|
"ui.button.update": "Update",
|
||||||
"ui.button.directUpdate": "Direct update",
|
"ui.button.directUpdate": "Direct update",
|
||||||
"ui.button.files": "Export Files",
|
"ui.button.files": "Import/Export",
|
||||||
"ui.button.excel": "Export Excel",
|
"ui.button.excel": "Export Excel",
|
||||||
"ui.button.uigf": "Export UIGF",
|
"ui.button.uigf": "Export UIGF",
|
||||||
"ui.button.import": "Import UIGF",
|
"ui.button.import": "Import UIGF",
|
||||||
@@ -57,6 +57,7 @@
|
|||||||
"ui.setting.fetchFullHistoryHint": "When this option is enabled, click the \"Update Data\" button to get all the card draw records within 6 months. When there are incorrect data within 6 months, this function can be used to repair.",
|
"ui.setting.fetchFullHistoryHint": "When this option is enabled, click the \"Update Data\" button to get all the card draw records within 6 months. When there are incorrect data within 6 months, this function can be used to repair.",
|
||||||
"ui.setting.closeProxy": "Disable system proxy",
|
"ui.setting.closeProxy": "Disable system proxy",
|
||||||
"ui.setting.closeProxyHint": "When you choose proxy mode, if the program crashes it can cause unwanted results that may affect your system. You can click this button to clear the system proxy settings.",
|
"ui.setting.closeProxyHint": "When you choose proxy mode, if the program crashes it can cause unwanted results that may affect your system. You can click this button to clear the system proxy settings.",
|
||||||
|
"ui.setting.idVersion": "ID database version",
|
||||||
"ui.about.title": "About",
|
"ui.about.title": "About",
|
||||||
"ui.about.license": "This software is opensource using MIT license.",
|
"ui.about.license": "This software is opensource using MIT license.",
|
||||||
"ui.urlDialog.title": "Input URL manually",
|
"ui.urlDialog.title": "Input URL manually",
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
"ui.button.load": "加载数据",
|
"ui.button.load": "加载数据",
|
||||||
"ui.button.update": "更新数据",
|
"ui.button.update": "更新数据",
|
||||||
"ui.button.directUpdate": "直接更新",
|
"ui.button.directUpdate": "直接更新",
|
||||||
"ui.button.files": "导出文件",
|
"ui.button.files": "导入/导出",
|
||||||
"ui.button.excel": "导出Excel",
|
"ui.button.excel": "导出Excel",
|
||||||
"ui.button.uigf":"导出UIGF",
|
"ui.button.uigf":"导出UIGF",
|
||||||
"ui.button.import":"导入UIGF",
|
"ui.button.import":"导入UIGF",
|
||||||
@@ -56,6 +56,7 @@
|
|||||||
"ui.setting.fetchFullHistoryHint": "开启时点击“更新数据”按钮会完整获取6个月内所有的抽卡记录,当记录里有6个月范围以内的错误数据时可以通过这个功能修复。",
|
"ui.setting.fetchFullHistoryHint": "开启时点击“更新数据”按钮会完整获取6个月内所有的抽卡记录,当记录里有6个月范围以内的错误数据时可以通过这个功能修复。",
|
||||||
"ui.setting.closeProxy": "关闭系统代理",
|
"ui.setting.closeProxy": "关闭系统代理",
|
||||||
"ui.setting.closeProxyHint": "如果使用过代理模式时工具非正常关闭,可能导致系统代理设置没能清除,可以通过这个按钮来清除设置过的系统代理。",
|
"ui.setting.closeProxyHint": "如果使用过代理模式时工具非正常关闭,可能导致系统代理设置没能清除,可以通过这个按钮来清除设置过的系统代理。",
|
||||||
|
"ui.setting.idVersion": "ID 数据库版本",
|
||||||
"ui.about.title": "关于",
|
"ui.about.title": "关于",
|
||||||
"ui.about.license": "本工具为开源软件,源代码使用 MIT 协议授权",
|
"ui.about.license": "本工具为开源软件,源代码使用 MIT 协议授权",
|
||||||
"ui.urlDialog.title": "手动输入URL",
|
"ui.urlDialog.title": "手动输入URL",
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
"ui.button.load": "加載數據",
|
"ui.button.load": "加載數據",
|
||||||
"ui.button.update": "更新數據",
|
"ui.button.update": "更新數據",
|
||||||
"ui.button.directUpdate": "直接更新",
|
"ui.button.directUpdate": "直接更新",
|
||||||
"ui.button.files": "導出文件",
|
"ui.button.files": "導入/匯出",
|
||||||
"ui.button.excel": "導出Excel",
|
"ui.button.excel": "導出Excel",
|
||||||
"ui.button.uigf":"導出UIGF",
|
"ui.button.uigf":"導出UIGF",
|
||||||
"ui.button.import":"導入UIGF",
|
"ui.button.import":"導入UIGF",
|
||||||
@@ -55,6 +55,7 @@
|
|||||||
"ui.setting.fetchFullHistoryHint": "開啟時點擊「更新數據」按鈕會完整獲取6個月內所有的抽卡記錄,當記錄裏有6個月範圍以內的錯誤數據時可以通過這個功能修復。",
|
"ui.setting.fetchFullHistoryHint": "開啟時點擊「更新數據」按鈕會完整獲取6個月內所有的抽卡記錄,當記錄裏有6個月範圍以內的錯誤數據時可以通過這個功能修復。",
|
||||||
"ui.setting.closeProxy": "關閉系統代理",
|
"ui.setting.closeProxy": "關閉系統代理",
|
||||||
"ui.setting.closeProxyHint": "如果使用過代理模式時工具非正常關閉,可能導致系統代理設置沒能清除,可以通過這個按鈕來清除設置過的系統代理。",
|
"ui.setting.closeProxyHint": "如果使用過代理模式時工具非正常關閉,可能導致系統代理設置沒能清除,可以通過這個按鈕來清除設置過的系統代理。",
|
||||||
|
"ui.setting.idVersion": "ID 數據庫版本",
|
||||||
"ui.about.title": "關於",
|
"ui.about.title": "關於",
|
||||||
"ui.about.license": "本工具為開源軟件,源代碼使用 MIT 協議授權",
|
"ui.about.license": "本工具為開源軟件,源代碼使用 MIT 協議授權",
|
||||||
"ui.urlDialog.title": "手動輸入URL",
|
"ui.urlDialog.title": "手動輸入URL",
|
||||||
|
1574
src/idJson.json
1574
src/idJson.json
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
|||||||
<div class="space-x-3">
|
<div class="space-x-3">
|
||||||
<el-button type="primary" :icon="state.status === 'init' ? 'milk-tea': 'refresh-right'" class="focus:outline-none" :disabled="!allowClick()" plain @click="fetchData()" :loading="state.status === 'loading'">{{state.status === 'init' ? ui.button.load: ui.button.update}}</el-button>
|
<el-button type="primary" :icon="state.status === 'init' ? 'milk-tea': 'refresh-right'" class="focus:outline-none" :disabled="!allowClick()" plain @click="fetchData()" :loading="state.status === 'loading'">{{state.status === 'init' ? ui.button.load: ui.button.update}}</el-button>
|
||||||
<el-dropdown :disabled="!gachaData" @command="exportCommand">
|
<el-dropdown :disabled="!gachaData" @command="exportCommand">
|
||||||
<el-button :disabled="!gachaData" icon="download" class="focus:outline-none" type="success" plain>
|
<el-button :disabled="!gachaData" icon="folder-opened" class="focus:outline-none" type="success" plain>
|
||||||
{{ui.button.files}}
|
{{ui.button.files}}
|
||||||
<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -12,10 +12,10 @@
|
|||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item command="excel">{{ui.button.excel}}</el-dropdown-item>
|
<el-dropdown-item command="excel">{{ui.button.excel}}</el-dropdown-item>
|
||||||
<el-dropdown-item command="uigf-json">{{ui.button.uigf}}</el-dropdown-item>
|
<el-dropdown-item command="uigf-json">{{ui.button.uigf}}</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="import-json" divided>{{ui.button.import}}</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<el-button @click="importData()" icon="upload" class="focus:outline-none" type="success" plain>{{ui.button.import}}</el-button>
|
|
||||||
<el-tooltip v-if="detail && state.status !== 'loading'" :content="ui.hint.newAccount" placement="bottom">
|
<el-tooltip v-if="detail && state.status !== 'loading'" :content="ui.hint.newAccount" placement="bottom">
|
||||||
<el-button @click="newUser()" plain icon="plus" class="focus:outline-none"></el-button>
|
<el-button @click="newUser()" plain icon="plus" class="focus:outline-none"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -290,6 +290,8 @@ const exportCommand = (type) => {
|
|||||||
saveExcel()
|
saveExcel()
|
||||||
} else if (type === 'uigf-json') {
|
} else if (type === 'uigf-json') {
|
||||||
exportUIGFJSON()
|
exportUIGFJSON()
|
||||||
|
} else if (type === 'import-json') {
|
||||||
|
importData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const openCacheFolder = async () => {
|
const openCacheFolder = async () => {
|
||||||
|
@@ -32,7 +32,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const chart = ref(null);
|
const chart = ref(null);
|
||||||
|
|
||||||
const colors = ["#eeaa66", "#fac858", "#ee6666", "#5470c6", "#ba66ee", "#91cc75", "#73c0de"];
|
const colors = ["#fac858", "#fac858", "#ee6666", "#5470c6", "#5470c6", "#91cc75", "#73c0de"];
|
||||||
|
|
||||||
const parseData = (detail, type) => {
|
const parseData = (detail, type) => {
|
||||||
const text = props.i18n.ui.data;
|
const text = props.i18n.ui.data;
|
||||||
|
@@ -47,6 +47,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<h3 class="text-lg my-4">{{about.title}}</h3>
|
<h3 class="text-lg my-4">{{about.title}}</h3>
|
||||||
|
<p class="text-gray-600 text-xs mt-1">{{text.idVersion}} {{idJson.version}}</p>
|
||||||
<p class="text-gray-600 text-xs mt-1">{{about.license}}</p>
|
<p class="text-gray-600 text-xs mt-1">{{about.license}}</p>
|
||||||
<p class="text-gray-600 text-xs mt-1">GitHub: <a @click="openGithub" class="cursor-pointer text-blue-400">https://github.com/earthjasonlin/zzz-signal-search-export</a></p>
|
<p class="text-gray-600 text-xs mt-1">GitHub: <a @click="openGithub" class="cursor-pointer text-blue-400">https://github.com/earthjasonlin/zzz-signal-search-export</a></p>
|
||||||
<p class="text-gray-600 text-xs mt-1 pb-6">UIGF: <a @click="openUIGF" class="cursor-pointer text-blue-400">https://uigf.org/</a></p>
|
<p class="text-gray-600 text-xs mt-1 pb-6">UIGF: <a @click="openUIGF" class="cursor-pointer text-blue-400">https://uigf.org/</a></p>
|
||||||
@@ -82,6 +83,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
const { ipcRenderer, shell } = require('electron')
|
const { ipcRenderer, shell } = require('electron')
|
||||||
|
import idJson from '../../idJson.json'
|
||||||
import { reactive, onMounted, computed } from 'vue'
|
import { reactive, onMounted, computed } from 'vue'
|
||||||
|
|
||||||
const emit = defineEmits(['close', 'changeLang', 'refreshData'])
|
const emit = defineEmits(['close', 'changeLang', 'refreshData'])
|
||||||
|
@@ -6,12 +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'
|
|
||||||
|
|
||||||
# 语言映射配置
|
# 语言映射配置
|
||||||
language_map = {
|
language_map = {
|
||||||
@@ -19,43 +14,74 @@ 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:
|
||||||
|
version_url = "https://api.hakush.in/zzz/new.json"
|
||||||
|
version_data = fetch_json(version_url)
|
||||||
|
|
||||||
|
latest_version = (
|
||||||
|
version_data.get("previous")[0] if version_data.get("previous") else "data"
|
||||||
|
)
|
||||||
|
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)
|
weapon_data = fetch_json(weapon_url)
|
||||||
character_data = fetch_json(character_url)
|
character_data = fetch_json(character_url)
|
||||||
bangboo_data = fetch_json(bangboo_url)
|
bangboo_data = fetch_json(bangboo_url)
|
||||||
|
|
||||||
transformed_data = {lang: {} for lang in language_map.keys()}
|
transformed_data = {lang: {} for lang in language_map.keys()}
|
||||||
|
|
||||||
|
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")
|
||||||
bangboo_transformed = transform_data(bangboo_data, "bangboo")
|
bangboo_transformed = transform_data(bangboo_data, "bangboo")
|
||||||
@@ -65,7 +91,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")
|
||||||
@@ -73,5 +99,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()
|
||||||
|
@@ -5205,10 +5205,10 @@ window-size@^1.1.1:
|
|||||||
define-property "^1.0.0"
|
define-property "^1.0.0"
|
||||||
is-number "^3.0.0"
|
is-number "^3.0.0"
|
||||||
|
|
||||||
winreg@^1.2.4:
|
winreg@1.2.4:
|
||||||
version "1.2.4"
|
version "1.2.4"
|
||||||
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.4.tgz#ba065629b7a925130e15779108cf540990e98d1b"
|
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.4.tgz#ba065629b7a925130e15779108cf540990e98d1b"
|
||||||
integrity sha1-ugZWKbepJRMOFXeRCM9UCZDpjRs=
|
integrity sha512-IHpzORub7kYlb8A43Iig3reOvlcBJGX9gZ0WycHhghHtA65X0LYnMRuJs+aH1abVnMJztQkvQNlltnbPi5aGIA==
|
||||||
|
|
||||||
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
|
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
|
||||||
version "7.0.0"
|
version "7.0.0"
|
||||||
@@ -5326,4 +5326,4 @@ zrender@5.2.1:
|
|||||||
resolved "https://registry.npmmirror.com/zrender/download/zrender-5.2.1.tgz#5f4bbda915ba6d412b0b19dc2431beaad05417bb"
|
resolved "https://registry.npmmirror.com/zrender/download/zrender-5.2.1.tgz#5f4bbda915ba6d412b0b19dc2431beaad05417bb"
|
||||||
integrity sha1-X0u9qRW6bUErCxncJDG+qtBUF7s=
|
integrity sha1-X0u9qRW6bUErCxncJDG+qtBUF7s=
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "2.3.0"
|
tslib "2.3.0"
|
||||||
|
Reference in New Issue
Block a user