This commit is contained in:
Horis
2025-12-05 22:21:58 +08:00
parent ab47e82ec9
commit 444821701f
@@ -322,7 +322,7 @@ interface JsExtensions : JsEncodeUtils {
fun downloadFile(url: String): String { fun downloadFile(url: String): String {
rhinoContext.ensureActive() rhinoContext.ensureActive()
val analyzeUrl = AnalyzeUrl(url, source = getSource(), coroutineContext = context) val analyzeUrl = AnalyzeUrl(url, source = getSource(), coroutineContext = context)
val type = UrlUtil.getSuffix(url, analyzeUrl.type) val type = analyzeUrl.type ?: UrlUtil.getSuffix(url)
val path = FileUtils.getPath( val path = FileUtils.getPath(
File(FileUtils.getCachePath()), File(FileUtils.getCachePath()),
"${MD5Utils.md5Encode16(url)}.${type}" "${MD5Utils.md5Encode16(url)}.${type}"