Repository navigation
cf: say when a mod page URL is given to install-curseforge #685 - #856
Merged
Merged
Conversation
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
requested changes
Aug 30, 2026
itzg
left a comment
Owner
There was a problem hiding this comment.
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( |
Owner
There was a problem hiding this comment.
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); |
Owner
There was a problem hiding this comment.
...and
Suggested change
| final Matcher other = MINECRAFT_PAGE_URL_PATTERN.matcher(pageUrl); | |
| final Matcher categoryMatcher = MINECRAFT_PAGE_URL_PATTERN.matcher(pageUrl); |
Contributor
Author
|
Renamed the pattern to PAGE_CATEGORY_URL_PATTERN and the matcher to categoryMatcher. |
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.
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