Skip to content

Fix Nexus downloads not extracting after API change#76

Open
LevelDreadnought wants to merge 1 commit into
ArmchairDevelopers:ver/beta10from
LevelDreadnought:nexus-filename-fix
Open

Fix Nexus downloads not extracting after API change#76
LevelDreadnought wants to merge 1 commit into
ArmchairDevelopers:ver/beta10from
LevelDreadnought:nexus-filename-fix

Conversation

@LevelDreadnought

Copy link
Copy Markdown

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 helper NexusDownloadService.resolveNexusFileName with a safe fallback chain:

  • Primary: the file's file_name from the V1 API, matched by file ID
  • Fallback: the filename provided in the download response headers
  • URL fallback: the filename from the URL, with an archive extension added if one is missing

These 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_name with 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 analyze is also clean for both modified files.

@LevelDreadnought
LevelDreadnought requested a review from 7reax as a code owner July 10, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant