mirror of
https://github.com/daydreamer-json/ak-endfield-api-archive.git
synced 2026-03-27 09:42:28 +01:00
refactor: improve web api fetch function reliability
This commit is contained in:
17
output/akEndfield/launcher/web/1/sidebar/en-us/all.json
Normal file
17
output/akEndfield/launcher/web/1/sidebar/en-us/all.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"updatedAt": "2026-03-07T21:43:25.899+09:00",
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 1,
|
||||||
|
"subChannel": 1,
|
||||||
|
"lang": "en-us",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
14
output/akEndfield/launcher/web/1/sidebar/en-us/latest.json
Normal file
14
output/akEndfield/launcher/web/1/sidebar/en-us/latest.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 1,
|
||||||
|
"subChannel": 1,
|
||||||
|
"lang": "en-us",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
17
output/akEndfield/launcher/web/1/sidebar/ja-jp/all.json
Normal file
17
output/akEndfield/launcher/web/1/sidebar/ja-jp/all.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"updatedAt": "2026-03-07T21:43:25.384+09:00",
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 1,
|
||||||
|
"subChannel": 1,
|
||||||
|
"lang": "ja-jp",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
14
output/akEndfield/launcher/web/1/sidebar/ja-jp/latest.json
Normal file
14
output/akEndfield/launcher/web/1/sidebar/ja-jp/latest.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 1,
|
||||||
|
"subChannel": 1,
|
||||||
|
"lang": "ja-jp",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
17
output/akEndfield/launcher/web/1/sidebar/ko-kr/all.json
Normal file
17
output/akEndfield/launcher/web/1/sidebar/ko-kr/all.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"updatedAt": "2026-03-07T21:43:25.807+09:00",
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 1,
|
||||||
|
"subChannel": 1,
|
||||||
|
"lang": "ko-kr",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
14
output/akEndfield/launcher/web/1/sidebar/ko-kr/latest.json
Normal file
14
output/akEndfield/launcher/web/1/sidebar/ko-kr/latest.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 1,
|
||||||
|
"subChannel": 1,
|
||||||
|
"lang": "ko-kr",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
17
output/akEndfield/launcher/web/1/sidebar/zh-tw/all.json
Normal file
17
output/akEndfield/launcher/web/1/sidebar/zh-tw/all.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"updatedAt": "2026-03-07T21:43:28.092+09:00",
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 1,
|
||||||
|
"subChannel": 1,
|
||||||
|
"lang": "zh-tw",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
14
output/akEndfield/launcher/web/1/sidebar/zh-tw/latest.json
Normal file
14
output/akEndfield/launcher/web/1/sidebar/zh-tw/latest.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 1,
|
||||||
|
"subChannel": 1,
|
||||||
|
"lang": "zh-tw",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
17
output/akEndfield/launcher/web/2/sidebar/en-us/all.json
Normal file
17
output/akEndfield/launcher/web/2/sidebar/en-us/all.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"updatedAt": "2026-03-07T21:43:27.188+09:00",
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 2,
|
||||||
|
"subChannel": 2,
|
||||||
|
"lang": "en-us",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
14
output/akEndfield/launcher/web/2/sidebar/en-us/latest.json
Normal file
14
output/akEndfield/launcher/web/2/sidebar/en-us/latest.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 2,
|
||||||
|
"subChannel": 2,
|
||||||
|
"lang": "en-us",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
17
output/akEndfield/launcher/web/2/sidebar/ja-jp/all.json
Normal file
17
output/akEndfield/launcher/web/2/sidebar/ja-jp/all.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"updatedAt": "2026-03-07T21:43:29.120+09:00",
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 2,
|
||||||
|
"subChannel": 2,
|
||||||
|
"lang": "ja-jp",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
14
output/akEndfield/launcher/web/2/sidebar/ja-jp/latest.json
Normal file
14
output/akEndfield/launcher/web/2/sidebar/ja-jp/latest.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 2,
|
||||||
|
"subChannel": 2,
|
||||||
|
"lang": "ja-jp",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
17
output/akEndfield/launcher/web/2/sidebar/ko-kr/all.json
Normal file
17
output/akEndfield/launcher/web/2/sidebar/ko-kr/all.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"updatedAt": "2026-03-07T21:43:28.560+09:00",
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 2,
|
||||||
|
"subChannel": 2,
|
||||||
|
"lang": "ko-kr",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
14
output/akEndfield/launcher/web/2/sidebar/ko-kr/latest.json
Normal file
14
output/akEndfield/launcher/web/2/sidebar/ko-kr/latest.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 2,
|
||||||
|
"subChannel": 2,
|
||||||
|
"lang": "ko-kr",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
17
output/akEndfield/launcher/web/2/sidebar/zh-tw/all.json
Normal file
17
output/akEndfield/launcher/web/2/sidebar/zh-tw/all.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"updatedAt": "2026-03-07T21:43:29.154+09:00",
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 2,
|
||||||
|
"subChannel": 2,
|
||||||
|
"lang": "zh-tw",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
14
output/akEndfield/launcher/web/2/sidebar/zh-tw/latest.json
Normal file
14
output/akEndfield/launcher/web/2/sidebar/zh-tw/latest.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"req": {
|
||||||
|
"appCode": "6LL0KJuqHBVz33WK",
|
||||||
|
"channel": 2,
|
||||||
|
"subChannel": 2,
|
||||||
|
"lang": "zh-tw",
|
||||||
|
"region": "cn",
|
||||||
|
"platform": "Windows"
|
||||||
|
},
|
||||||
|
"rsp": {
|
||||||
|
"data_version": "",
|
||||||
|
"sidebars": []
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -445,43 +445,52 @@ async function fetchAndSaveAllGameResRawData(gameTargets: GameTarget[]) {
|
|||||||
for (const target of gameTargets) {
|
for (const target of gameTargets) {
|
||||||
for (const lang of apiUtils.akEndfield.defaultSettings.launcherWebLang) {
|
for (const lang of apiUtils.akEndfield.defaultSettings.launcherWebLang) {
|
||||||
{
|
{
|
||||||
const data: StoredData<Awaited<ReturnType<typeof apiUtils.akEndfield.launcherWeb.banner>>>[] = await Bun.file(
|
const allPath = path.join(infileBasePath, String(target.subChannel), 'banner', lang, 'all.json');
|
||||||
path.join(infileBasePath, String(target.subChannel), 'banner', lang, 'all.json'),
|
if (await Bun.file(allPath).exists()) {
|
||||||
).json();
|
const data: StoredData<Awaited<ReturnType<typeof apiUtils.akEndfield.launcherWeb.banner>>>[] =
|
||||||
for (const dataEntry of data) {
|
await Bun.file(allPath).json();
|
||||||
if (!dataEntry.rsp) continue;
|
for (const dataEntry of data) {
|
||||||
dataEntry.rsp.banners.forEach((e) => urlSet.add(e.url));
|
if (!dataEntry.rsp) continue;
|
||||||
|
dataEntry.rsp.banners.forEach((e) => urlSet.add(e.url));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const data: StoredData<Awaited<ReturnType<typeof apiUtils.akEndfield.launcherWeb.mainBgImage>>>[] =
|
const allPath = path.join(infileBasePath, String(target.subChannel), 'main_bg_image', lang, 'all.json');
|
||||||
await Bun.file(
|
if (await Bun.file(allPath).exists()) {
|
||||||
path.join(infileBasePath, String(target.subChannel), 'main_bg_image', lang, 'all.json'),
|
const data: StoredData<Awaited<ReturnType<typeof apiUtils.akEndfield.launcherWeb.mainBgImage>>>[] =
|
||||||
).json();
|
await Bun.file(allPath).json();
|
||||||
for (const dataEntry of data) {
|
for (const dataEntry of data) {
|
||||||
if (!dataEntry.rsp) continue;
|
if (!dataEntry.rsp) continue;
|
||||||
urlSet.add(dataEntry.rsp.main_bg_image.url);
|
urlSet.add(dataEntry.rsp.main_bg_image.url);
|
||||||
if (dataEntry.rsp.main_bg_image.video_url) urlSet.add(dataEntry.rsp.main_bg_image.video_url);
|
if (dataEntry.rsp.main_bg_image.video_url) urlSet.add(dataEntry.rsp.main_bg_image.video_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const data: StoredData<Awaited<ReturnType<typeof apiUtils.akEndfield.launcherWeb.sidebar>>>[] =
|
const allPath = path.join(infileBasePath, String(target.subChannel), 'sidebar', lang, 'all.json');
|
||||||
await Bun.file(path.join(infileBasePath, String(target.subChannel), 'sidebar', lang, 'all.json')).json();
|
if (await Bun.file(allPath).exists()) {
|
||||||
for (const dataEntry of data) {
|
const data: StoredData<Awaited<ReturnType<typeof apiUtils.akEndfield.launcherWeb.sidebar>>>[] =
|
||||||
if (!dataEntry.rsp) continue;
|
await Bun.file(allPath).json();
|
||||||
dataEntry.rsp.sidebars.forEach((e) => {
|
for (const dataEntry of data) {
|
||||||
if (e.pic !== null && e.pic.url) urlSet.add(e.pic.url);
|
if (!dataEntry.rsp) continue;
|
||||||
});
|
dataEntry.rsp.sidebars.forEach((e) => {
|
||||||
|
if (e.pic !== null && e.pic.url) urlSet.add(e.pic.url);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const data: StoredData<Awaited<ReturnType<typeof apiUtils.akEndfield.launcherWeb.singleEnt>>>[] =
|
const allPath = path.join(infileBasePath, String(target.subChannel), 'single_ent', lang, 'all.json');
|
||||||
await Bun.file(path.join(infileBasePath, String(target.subChannel), 'single_ent', lang, 'all.json')).json();
|
if (await Bun.file(allPath).exists()) {
|
||||||
for (const dataEntry of data) {
|
const data: StoredData<Awaited<ReturnType<typeof apiUtils.akEndfield.launcherWeb.singleEnt>>>[] =
|
||||||
if (!dataEntry.rsp) continue;
|
await Bun.file(allPath).json();
|
||||||
[dataEntry.rsp.single_ent.version_url].forEach((e) => {
|
for (const dataEntry of data) {
|
||||||
if (e) urlSet.add(e);
|
if (!dataEntry.rsp) continue;
|
||||||
});
|
[dataEntry.rsp.single_ent.version_url].forEach((e) => {
|
||||||
|
if (e) urlSet.add(e);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user