diff --git a/lib/core.ps1 b/lib/core.ps1 index 6f70740735..3945bd4682 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -656,9 +656,9 @@ function handle_special_urls($url) } # Sourceforge.net - if ($url -match "(?:downloads\.)?sourceforge.net\/projects?\/(?[^\/]+)\/(?:files\/)?(?.*)") { + if ($url -match "(?:downloads\.)?sourceforge.net\/projects?\/(?[^\/]+)\/(?:files\/)?(?.*?)(?:$|\/download|\?)") { # Reshapes the URL to avoid redirections - $url = "https://downloads.sourceforge.net/project/$($matches['project'])/$($matches['file'])?r=&ts=" + $url = "https://downloads.sourceforge.net/project/$($matches['project'])/$($matches['file'])" } return $url }