debug(schematics): add project page download link logging
All checks were successful
Deploy to Docker / deploy (push) Successful in 1m23s

Log all download-related links, schematic file references, and
download path types found on the project page to diagnose 404s.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-17 02:18:24 +00:00
parent d10ceb787b
commit ddc1dc2751

View File

@@ -123,6 +123,16 @@ export async function fetchSchematic(url) {
throw new Error(`Failed to fetch project page: ${err.message}`); throw new Error(`Failed to fetch project page: ${err.message}`);
} }
// Debug: log download-related links found on the project page
const dlLinks = html.match(/href="[^"]*download[^"]*"/gi) || [];
log(TAG, `Project page download links: ${dlLinks.length}${dlLinks.slice(0, 10).join(', ')}`);
// Also check for any schematic/schem references
const schemRefs = html.match(/\.(schematic|schem|litematic|nbt)/gi) || [];
log(TAG, `Schematic file references: ${schemRefs.length}${[...new Set(schemRefs)].join(', ')}`);
// Check for share type / download section
const shareMatch = html.match(/download\/([^/"]+)/g) || [];
log(TAG, `Download path types: ${[...new Set(shareMatch)].join(', ')}`);
// Extract metadata // Extract metadata
const titleMatch = html.match(/<title>([^<]+)<\/title>/i); const titleMatch = html.match(/<title>([^<]+)<\/title>/i);
const name = titleMatch const name = titleMatch