node build fixed
This commit is contained in:
20
seanime-2.9.10/internal/torrents/torrent/utils.go
Normal file
20
seanime-2.9.10/internal/torrents/torrent/utils.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package torrent
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/anacrolix/torrent/metainfo"
|
||||
)
|
||||
|
||||
func StrDataToMagnetLink(data string) (string, error) {
|
||||
meta, err := metainfo.Load(bytes.NewReader([]byte(data)))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
magnetLink, err := meta.MagnetV2()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return magnetLink.String(), nil
|
||||
}
|
||||
Reference in New Issue
Block a user