@@ -45,7 +45,7 @@ func (d *Strm) Init(ctx context.Context) error {
4545 return errors .New ("SaveStrmLocalPath is required" )
4646 }
4747 d .pathMap = make (map [string ][]string )
48- for _ , path := range strings .Split (d .Paths , "\n " ) {
48+ for path := range strings .SplitSeq (d .Paths , "\n " ) {
4949 path = strings .TrimSpace (path )
5050 if path == "" {
5151 continue
@@ -97,17 +97,17 @@ func (d *Strm) Init(ctx context.Context) error {
9797 }
9898
9999 if d .Version != 5 {
100- types := strings .Split ("mp4,mkv,flv,avi,wmv,ts,rmvb,webm,mp3,flac,aac,wav,ogg,m4a,wma,alac" , "," )
101- for _ , ext := range types {
100+ types := strings .SplitSeq ("mp4,mkv,flv,avi,wmv,ts,rmvb,webm,mp3,flac,aac,wav,ogg,m4a,wma,alac" , "," )
101+ for ext := range types {
102102 if _ , ok := d .supportSuffix [ext ]; ! ok {
103103 d .supportSuffix [ext ] = struct {}{}
104104 supportTypes = append (supportTypes , ext )
105105 }
106106 }
107107 d .FilterFileTypes = strings .Join (supportTypes , "," )
108108
109- types = strings .Split ("ass,srt,vtt,sub,strm" , "," )
110- for _ , ext := range types {
109+ types = strings .SplitSeq ("ass,srt,vtt,sub,strm" , "," )
110+ for ext := range types {
111111 if _ , ok := d .downloadSuffix [ext ]; ! ok {
112112 d .downloadSuffix [ext ] = struct {}{}
113113 downloadTypes = append (downloadTypes , ext )
@@ -127,7 +127,7 @@ func (d *Strm) Drop(ctx context.Context) error {
127127 d .pathMap = nil
128128 d .downloadSuffix = nil
129129 d .supportSuffix = nil
130- for _ , path := range strings .Split (d .Paths , "\n " ) {
130+ for path := range strings .SplitSeq (d .Paths , "\n " ) {
131131 RemoveStrm (utils .FixAndCleanPath (strings .TrimSpace (path )), d )
132132 }
133133 return nil
0 commit comments