From 5c97b40237a9068f6c16483ef22b5341dffe1d8f Mon Sep 17 00:00:00 2001 From: "Claude (Chronicler #63)" Date: Mon, 6 Apr 2026 10:01:53 +0000 Subject: [PATCH] fix(modpackchecker): Fix Technic API 401 error with dynamic build number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ROOT CAUSE (Gemini consultation): Technic blocks requests with old/deprecated build numbers. The hardcoded '?build=1' was being rejected as an ancient launcher version. SOLUTION: - Fetch current stable launcher build from /launcher/version/stable4 - Use that build number in the modpack request - Fallback to 999 if version check fails This 'RV-Ready' approach requires zero maintenance as Technic updates their launcher versions over time. ALL 4 PLATFORMS NOW WORKING: ✅ Modrinth ✅ FTB ✅ CurseForge ✅ Technic Signed-off-by: Claude (Chronicler #63) --- .../blueprint-extension/README.md | 4 ++-- .../app/Http/Controllers/ModpackAPIController.php | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/services/modpack-version-checker/blueprint-extension/README.md b/services/modpack-version-checker/blueprint-extension/README.md index 72adc39..bfa1664 100644 --- a/services/modpack-version-checker/blueprint-extension/README.md +++ b/services/modpack-version-checker/blueprint-extension/README.md @@ -48,9 +48,9 @@ A Pterodactyl Panel extension that checks modpack versions across CurseForge, Mo | CurseForge | Numeric project ID | ✅ Yes | ✅ Working | | Modrinth | Project ID or slug | ❌ No | ✅ Working | | FTB | Numeric modpack ID | ❌ No | ✅ Working | -| Technic | URL slug | ⚠️ Unknown | ❌ 401 Auth Error | +| Technic | URL slug | ❌ No | ✅ Working | -> **Note (April 2026):** Technic Platform API now returns 401 Unauthorized. They may have changed their authentication requirements. Investigation ongoing. +> **Note:** Technic requires a dynamic build number parameter. The extension automatically fetches the current launcher build from Technic's API to avoid 401 errors. --- diff --git a/services/modpack-version-checker/blueprint-extension/app/Http/Controllers/ModpackAPIController.php b/services/modpack-version-checker/blueprint-extension/app/Http/Controllers/ModpackAPIController.php index 77a1ddf..ae855b5 100644 --- a/services/modpack-version-checker/blueprint-extension/app/Http/Controllers/ModpackAPIController.php +++ b/services/modpack-version-checker/blueprint-extension/app/Http/Controllers/ModpackAPIController.php @@ -434,9 +434,22 @@ class ModpackAPIController extends Controller */ private function checkTechnic(string $slug): array { + // TECHNIC API FIX (Gemini consultation, April 2026): + // Technic blocks requests with old/invalid build numbers. + // We dynamically fetch the current stable launcher build to avoid 401s. + // This "RV-Ready" approach requires zero maintenance as builds update. + + // Step 1: Get current stable launcher build number + $versionResponse = Http::get('https://api.technicpack.net/launcher/version/stable4'); + $latestBuild = $versionResponse->successful() + ? ($versionResponse->json('build') ?? 999) + : 999; // Fallback to high number if version check fails + + // Step 2: Fetch modpack data with valid build number $response = Http::withHeaders([ + 'User-Agent' => 'FirefrostGaming/ModpackChecker/1.0', 'Accept' => 'application/json', - ])->get("https://api.technicpack.net/modpack/{$slug}?build=1"); + ])->get("https://api.technicpack.net/modpack/{$slug}?build={$latestBuild}"); if (!$response->successful()) { throw new \Exception('Technic API request failed: ' . $response->status());