diff --git a/server/controllers/other.go b/server/controllers/other.go index 6a4968f3..79e36840 100644 --- a/server/controllers/other.go +++ b/server/controllers/other.go @@ -7,6 +7,7 @@ import ( "github.com/Xhofe/alist/server/common" "github.com/Xhofe/alist/utils" "github.com/gin-gonic/gin" + "net/url" "strings" ) @@ -24,11 +25,19 @@ func Plist(c *gin.Context) { return } u := string(bytes) + uUrl, err := url.Parse(u) + if err != nil { + common.ErrorResp(c, err, 500) + return + } name := utils.Base(u) + u = uUrl.String() ipaIndex := strings.Index(name, ".ipa") if ipaIndex != -1 { name = name[:ipaIndex] } + name = strings.ReplaceAll(name, "<", "[") + name = strings.ReplaceAll(name, ">", "]") plist := fmt.Sprintf(`