Skip to content

Commit 1c67d34

Browse files
committed
feat: provide db.go locally to wii-downloader; the upstream file changes constantly so the hash is always changing
1 parent 02b2c02 commit 1c67d34

File tree

3 files changed

+43
-12
lines changed

3 files changed

+43
-12
lines changed

pkgs/wiiu-downloader/db.go

Lines changed: 14 additions & 0 deletions
Large diffs are not rendered by default.

pkgs/wiiu-downloader/package.nix

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,13 @@
1010
wrapGAppsHook3,
1111
}:
1212
let
13-
# Fetch the db.go file that would normally be downloaded by grabTitles.py
13+
# db.go file that would normally be downloaded by grabTitles.py
1414
# This is required for the build and contains title database definitions
15-
db-go = fetchurl {
16-
url = "https://napi.v10lator.de/db?t=go";
17-
hash = "sha256-srCjg2dZwALOVhyOL6C++3nJpK9BropCCmcY0DhUxrU=";
18-
# Server has HTTP/2 issues, force HTTP/1.1 and use custom user agent
19-
curlOptsList = [
20-
"--http1.1"
21-
"-H"
22-
"User-Agent: NUSspliBuilder/2.1"
23-
];
24-
};
15+
# Run ./update-db.fish to update this file, if ever needed
16+
db-go = ./db.go;
2517
in
2618
buildGoModule rec {
27-
pname = "wiiudownloader";
19+
pname = "wiiu-downloader";
2820
version = "2.68";
2921

3022
src = fetchFromGitHub {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env fish
2+
3+
# Update db.go from WiiU downloader API
4+
# Run this script when you need to update the title database
5+
6+
set -l script_dir (dirname (status -f))
7+
set -l db_file "$script_dir/db.go"
8+
9+
echo "Updating WiiU Downloader database..."
10+
11+
# Download with proper headers
12+
if curl --http1.1 \
13+
-H "User-Agent: NUSspliBuilder/2.1" \
14+
"https://napi.v10lator.de/db?t=go" \
15+
-o "$db_file"
16+
echo "Successfully downloaded db.go"
17+
echo "File saved to: $db_file"
18+
19+
# Show update timestamp in the file
20+
set -l timestamp (head -2 "$db_file" | tail -1)
21+
echo "$timestamp"
22+
else
23+
echo "❌ Failed to download db.go"
24+
exit 1
25+
end

0 commit comments

Comments
 (0)