Fix Nexus downloads not extracting after API change#76
Open
LevelDreadnought wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Mod files download successfully from Nexus but fail to unpack into the mod collection directory. The downloaded file lands on disk without an archive extension, so extraction is skipped.
Cause
On June 11th, 2026, Nexus switched the website and download back-end over to their new Upload API. As a result, CDN download URLs no longer contain the mod file's filename or extension in their path. This change is detailed by Nexus at https://forums.nexusmods.com/topic/13539100-changes-to-downloaded-file-names/. Since the launcher derived the filename from the URL path, the saved file had no archive extension, so
ArchiveExtractor.isArchive()returned false and extraction was skipped.Fix
Resolve the filename from the Nexus V1 REST API (
getModFiles().file_name), which still returns the correct filename with its extension, instead of scraping it from the URL. I also added a shared helperNexusDownloadService.resolveNexusFileNamewith a safe fallback chain:file_namefrom the V1 API, matched by file IDThese fixes apply to both the in-app mod browser (premium API and non-premium webview branches) and the
nxm://"Mod Manager Download" links on the Nexus website.Testing
The fix was verified against several mod files uploaded to Nexus after the Upload API change. The V1 API returned each file's
file_namewith its correct archive extension. Restoring that extension correctly allowed the extractor to unpack the download and add the file(s) to the mod directory, instead of skipping it.dart analyzeis also clean for both modified files.