i give up

This commit is contained in:
tresabhi committed 2026-08-13 12:01:16 -05:00
1 parent 4d0f21e10b
commit 204c3eacc1
3 files changed
+51 -1

No files matched your search

+5
View File
@@ -115,6 +115,11 @@ jobs:
with: with:
repo-token: ${{ secrets.GH_TOKEN }} repo-token: ${{ secrets.GH_TOKEN }}
- name: Setup aria2
run: |
sudo apt-get update
sudo apt-get install -y aria2
- name: Configure pages - name: Configure pages
uses: actions/configure-pages@v6 uses: actions/configure-pages@v6
@@ -2,3 +2,8 @@
export const DEPOT_DOWNLOADER_MAX_DOWNLOADS = 256; export const DEPOT_DOWNLOADER_MAX_DOWNLOADS = 256;
export const DEPOT_DOWNLOADER_OUTPUT = "../../temp/depotdownloader"; export const DEPOT_DOWNLOADER_OUTPUT = "../../temp/depotdownloader";
export const DEPOT_DOWNLOADER_EXECUTABLE = `${DEPOT_DOWNLOADER_OUTPUT}/DepotDownloader`; export const DEPOT_DOWNLOADER_EXECUTABLE = `${DEPOT_DOWNLOADER_OUTPUT}/DepotDownloader`;
export const ARIA2_OUTPUT = "../../temp/aria2";
export const ARIA2_EXECUTABLE = `${ARIA2_OUTPUT}/aria2c`;
export const WGPKG_DIR = "../../temp/wgpkgs";
+41 -1
View File
@@ -5,6 +5,7 @@ import {
DEPOT_DOWNLOADER_EXECUTABLE, DEPOT_DOWNLOADER_EXECUTABLE,
DEPOT_DOWNLOADER_MAX_DOWNLOADS, DEPOT_DOWNLOADER_MAX_DOWNLOADS,
DEPOT_DOWNLOADER_OUTPUT, DEPOT_DOWNLOADER_OUTPUT,
WGPKG_DIR,
} from "./constants"; } from "./constants";
import { QuickGitHubRelease } from "./types"; import { QuickGitHubRelease } from "./types";
@@ -49,9 +50,48 @@ if (provider === "steam") {
} else if (provider === "zip") { } else if (provider === "zip") {
const url = assertSecret(import.meta.env.CLIENT_SOURCE); const url = assertSecret(import.meta.env.CLIENT_SOURCE);
await mkdir(dir, { recursive: true }); console.log("Downloading and extracting zipped client...");
await mkdir(dir, { recursive: true });
await $`curl -L "${url}" | bsdtar -xf- --strip-components=1 -C ${dir}`; await $`curl -L "${url}" | bsdtar -xf- --strip-components=1 -C ${dir}`;
} else if (provider === "wgpkg") {
let index = 1;
const urls: string[] = [];
console.log("Discovering packages...");
while (true) {
const url = `${source}.${index.toString().padStart(3, "0")}`;
const response = await fetch(url);
if (response.status === 200) {
urls.push(url);
} else if (response.status === 404) {
break;
} else {
throw new Error(`Wargaming response error status: ${response.status}`);
}
index++;
}
console.log(`Downloading ${urls.length} packages...`);
await rm(WGPKG_DIR, { recursive: true });
const inputContent = urls
.map((url) => {
const name = url.split("/").pop()!;
return `${url}\n out=${name}\n dir=${WGPKG_DIR}`;
})
.join("\n");
await $`echo ${inputContent} | aria2c -j ${urls.length} -x 2 -s 2 -i -`;
const firstChunk = `${WGPKG_DIR}/${urls[0].split("/").pop()!}`;
await $`7z x "${firstChunk}" -o${dir} -y`;
await rm(WGPKG_DIR, { recursive: true });
} else { } else {
throw new Error(`Unknown provider: ${provider}`); throw new Error(`Unknown provider: ${provider}`);
} }