feat: curseforge modpack downloading via binaryname:// uri (#4872)

This commit is contained in:
Alexandru Ionut Tripon 2026-03-17 06:03:41 +00:00 committed by GitHub
commit 662a448080
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -947,10 +947,20 @@ void MainWindow::processURLs(QList<QUrl> urls)
(url.path().startsWith("/import", Qt::CaseInsensitive));
QUrl dl_url;
if (url.scheme() == "curseforge") {
if (url.scheme() == "curseforge" || (url.scheme() == BuildConfig.LAUNCHER_APP_BINARY_NAME && url.host() == "install")) {
// need to find the download link for the modpack / resource
// format of url curseforge://install?addonId=IDHERE&fileId=IDHERE
// format of url binaryname://install?platform=curseforge&addonId=IDHERE&fileId=IDHERE
QUrlQuery query(url);
// check if this is a binaryname:// url
if (url.scheme() == BuildConfig.LAUNCHER_APP_BINARY_NAME) {
// check this is an curseforge platform request
if (query.queryItemValue("platform").toLower() != "curseforge") {
qDebug() << "Invalid mod distribution platform:" << query.queryItemValue("platform");
continue;
}
}
if (query.allQueryItemValues("addonId").isEmpty() || query.allQueryItemValues("fileId").isEmpty()) {
qDebug() << "Invalid curseforge link:" << url;