File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11package handles
22
33import (
4+ "strings"
5+
46 _115 "github.com/OpenListTeam/OpenList/v4/drivers/115"
57 _115_open "github.com/OpenListTeam/OpenList/v4/drivers/115_open"
68 "github.com/OpenListTeam/OpenList/v4/drivers/pikpak"
@@ -406,8 +408,14 @@ func AddOfflineDownload(c *gin.Context) {
406408 }
407409 var tasks []task.TaskExtensionInfo
408410 for _ , url := range req .Urls {
411+ // Filter out empty lines and whitespace-only strings
412+ trimmedUrl := strings .TrimSpace (url )
413+ if trimmedUrl == "" {
414+ continue
415+ }
416+
409417 t , err := tool .AddURL (c , & tool.AddURLArgs {
410- URL : url ,
418+ URL : trimmedUrl ,
411419 DstDirPath : reqPath ,
412420 Tool : req .Tool ,
413421 DeletePolicy : tool .DeletePolicy (req .DeletePolicy ),
You can’t perform that action at this time.
0 commit comments