Skip to content

cf: say when a mod page URL is given to install-curseforge #685 - #856

Merged
itzg merged 2 commits into
itzg:mainfrom
AzazelSensei:fix-685-mod-page-url-error
Aug 30, 2026
Merged

itzg merged 2 commits into
itzg:mainfrom
AzazelSensei:fix-685-mod-page-url-error

Conversation

@AzazelSensei

Copy link
Copy Markdown
Contributor

A CurseForge mod file URL was failing as "Unexpected CF page URL structure", which looks like an API key problem.

install-curseforge now says the URL is an mc-mods (or other non-modpack) page and points at curseforge-files for individual mods.

Fixes #685

install-curseforge only accepts /minecraft/modpacks/ URLs. A /mc-mods/
page used to look like a generic "Unexpected CF page URL structure"
error, which people read as an API key problem.

@itzg itzg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just a couple of naming tweaks.

private static final Pattern PAGE_URL_PATTERN = Pattern.compile(
"https://(www|beta)\\.curseforge\\.com/minecraft/modpacks/(?<slug>[^/]+?)(/((files|download)(/(?<fileId>\\d+)?)?)?)?");

private static final Pattern MINECRAFT_PAGE_URL_PATTERN = Pattern.compile(

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name confused me about the purpose of this, so this would have helped med

Suggested change
private static final Pattern MINECRAFT_PAGE_URL_PATTERN = Pattern.compile(
private static final Pattern PAGE_CATEGORY_URL_PATTERN = Pattern.compile(

throw new InvalidParameterException("Unexpected CF page URL structure: " + pageUrl);
}

final Matcher other = MINECRAFT_PAGE_URL_PATTERN.matcher(pageUrl);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and

Suggested change
final Matcher other = MINECRAFT_PAGE_URL_PATTERN.matcher(pageUrl);
final Matcher categoryMatcher = MINECRAFT_PAGE_URL_PATTERN.matcher(pageUrl);

@AzazelSensei

Copy link
Copy Markdown
Contributor Author

Renamed the pattern to PAGE_CATEGORY_URL_PATTERN and the matcher to categoryMatcher.

@itzg itzg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes.

@itzg
itzg merged commit 29ed3f0 into itzg:main Aug 30, 2026
1 check passed
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.

cf: Improve error message when mod page given for modpack

2 participants