Add support for legacy.curseforge.com URLs

This commit is contained in:
comp500 2023-05-31 15:22:00 +01:00
parent 2b878f5e28
commit 7b380f23df

View File

@ -121,7 +121,7 @@ func getCurseforgeVersions(mcVersions []string) []string {
var urlRegexes = [...]*regexp.Regexp{ var urlRegexes = [...]*regexp.Regexp{
regexp.MustCompile(`^https?://(?P<game>minecraft)\.curseforge\.com/projects/(?P<slug>[^/]+)(?:/(?:files|download)/(?P<fileID>\d+))?`), regexp.MustCompile(`^https?://(?P<game>minecraft)\.curseforge\.com/projects/(?P<slug>[^/]+)(?:/(?:files|download)/(?P<fileID>\d+))?`),
regexp.MustCompile(`^https?://(?:www\.|beta\.)?curseforge\.com/(?P<game>[^/]+)/(?P<category>[^/]+)/(?P<slug>[^/]+)(?:/(?:files|download)/(?P<fileID>\d+))?`), regexp.MustCompile(`^https?://(?:www\.|beta\.|legacy\.)?curseforge\.com/(?P<game>[^/]+)/(?P<category>[^/]+)/(?P<slug>[^/]+)(?:/(?:files|download)/(?P<fileID>\d+))?`),
regexp.MustCompile(`^(?P<slug>[a-z][\da-z\-_]{0,127})$`), regexp.MustCompile(`^(?P<slug>[a-z][\da-z\-_]{0,127})$`),
} }