This commit is contained in:
nikk gitanes
2021-09-13 04:11:21 +03:00
parent 617f51711d
commit 4565396f9d
3 changed files with 7 additions and 7 deletions

View File

@@ -24,7 +24,7 @@ func ParseFile(file multipart.File) (*torrent.TorrentSpec, error) {
return nil, err
}
// mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
// mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
mag := minfo.Magnet(nil, &info)
return &torrent.TorrentSpec{
InfoBytes: minfo.InfoBytes,
@@ -106,7 +106,7 @@ func fromHttp(link string) (*torrent.TorrentSpec, error) {
if err != nil {
return nil, err
}
// mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
// mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
mag := minfo.Magnet(nil, &info)
return &torrent.TorrentSpec{
@@ -130,7 +130,7 @@ func fromFile(path string) (*torrent.TorrentSpec, error) {
return nil, err
}
// mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
// mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
mag := minfo.Magnet(nil, &info)
return &torrent.TorrentSpec{
InfoBytes: minfo.InfoBytes,

View File

@@ -28,7 +28,7 @@ func getTorrents(c *gin.Context) {
mi := metainfo.MetaInfo{
AnnounceList: ts.Trackers,
}
// mag := mi.Magnet(ts.DisplayName, ts.InfoHash)
// mag := mi.Magnet(ts.DisplayName, ts.InfoHash)
mag := mi.Magnet(&ts.InfoHash, &metainfo.Info{Name: ts.DisplayName})
http += "<p><a href='" + mag.String() + "'>magnet:?xt=urn:btih:" + mag.InfoHash.HexString() + "</a></p>"
}