import (
"github.com/anacrolix/bargle"
+ "github.com/anacrolix/tagflag"
"github.com/anacrolix/torrent/bencode"
"github.com/anacrolix/torrent/metainfo"
"os"
Comment string `name:"t" help:"comment"`
CreatedBy string `name:"c" help:"created by"`
InfoName *string `name:"i" help:"override info name (defaults to ROOT)"`
+ PieceLength tagflag.Bytes
Url []string `name:"u" help:"add webseed url"`
- Root string `arg:"positional"`
+ Private *bool
+ Root string `arg:"positional"`
}
cmd = bargle.FromStruct(&args)
cmd.Desc = "Creates a torrent metainfo for the file system rooted at ROOT, and outputs it to stdout"
mi.CreatedBy = args.CreatedBy
}
mi.UrlList = args.Url
- info := metainfo.Info{}
+ info := metainfo.Info{
+ PieceLength: args.PieceLength.Int64(),
+ Private: args.Private,
+ }
err = info.BuildFromFilePath(args.Root)
if err != nil {
return
require (
github.com/alecthomas/atomic v0.1.0-alpha2 // indirect
github.com/alexflint/go-scalar v1.1.0 // indirect
- github.com/anacrolix/bargle v0.0.0-20220622082028-6c0bfc8b614d // indirect
+ github.com/anacrolix/bargle v0.0.0-20220630015206-d7a4d433886a // indirect
github.com/anacrolix/mmsg v1.0.0 // indirect
github.com/anacrolix/stm v0.4.0 // indirect
github.com/benbjohnson/immutable v0.3.0 // indirect
github.com/anacrolix/bargle v0.0.0-20220620083758-c3885e1796d1/go.mod h1:cC/kX8wL4i1n+63lOrXhPQQlsoxCo0EqV88fGExQwcY=
github.com/anacrolix/bargle v0.0.0-20220622082028-6c0bfc8b614d h1:eSBxjJUsa4p5lCn8mlp6gOdzhZYZxqr4YHPk8Uwn1iQ=
github.com/anacrolix/bargle v0.0.0-20220622082028-6c0bfc8b614d/go.mod h1:9xUiZbkh+94FbiIAL1HXpAIBa832f3Mp07rRPl5c5RQ=
+github.com/anacrolix/bargle v0.0.0-20220627055849-08d7fa720ece h1:QPZd4ViWNy2uxIbrj1fIhvLxpe27GrnzaaVHGfY6Aac=
+github.com/anacrolix/bargle v0.0.0-20220627055849-08d7fa720ece/go.mod h1:9xUiZbkh+94FbiIAL1HXpAIBa832f3Mp07rRPl5c5RQ=
+github.com/anacrolix/bargle v0.0.0-20220630015206-d7a4d433886a h1:KCP9QvHlLoUQBOaTf/YCuOzG91Ym1cPB6S68O4Q3puo=
+github.com/anacrolix/bargle v0.0.0-20220630015206-d7a4d433886a/go.mod h1:9xUiZbkh+94FbiIAL1HXpAIBa832f3Mp07rRPl5c5RQ=
github.com/anacrolix/chansync v0.3.0 h1:lRu9tbeuw3wl+PhMu/r+JJCRu5ArFXIluOgdF0ao6/U=
github.com/anacrolix/chansync v0.3.0/go.mod h1:DZsatdsdXxD0WiwcGl0nJVwyjCKMDv+knl1q2iBjA2k=
github.com/anacrolix/dht/v2 v2.18.0 h1:btjVjzjKqO5nKGbJHJ2UmuwiRx+EgX3e+OCHC9+WRz8=