mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 14:23:42 +00:00
feat: http downloader
This commit is contained in:
1 parent
15e5d2af3b
commit
788376eaa9
22 files changed
+813
-64
No files matched your search
@@ -3,31 +3,20 @@ package metainfo
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"github.com/RoaringBitmap/roaring"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestParseFromFile(t *testing.T) {
|
||||
// metaInfo, err := ParseFromFile("../testdata/Game.of.Thrones.S08E05.720p.WEB.H264-MEMENTO.torrent")
|
||||
metaInfo, err := ParseFromFile("../testdata/office.torrent")
|
||||
metaInfo, err := ParseFromFile("E:\\bt\\win10.torrent")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("%+v\n", metaInfo.AnnounceList)
|
||||
fmt.Printf("%+v\n", metaInfo.Info.Files)
|
||||
for _, file := range metaInfo.Info.Files {
|
||||
fmt.Printf("%+v\n", file)
|
||||
}
|
||||
fmt.Printf("%+v\n", metaInfo.Info.PieceLength)
|
||||
fmt.Printf("%+v\n", len(metaInfo.Info.Pieces))
|
||||
fmt.Printf("%+v\n", hex.EncodeToString(metaInfo.infoHash[:]))
|
||||
}
|
||||
|
||||
func TestParseFromFile2(t *testing.T) {
|
||||
a := 0b10010000
|
||||
b := 0b01111111
|
||||
fmt.Printf("%08b\n", (a&b)^b)
|
||||
|
||||
have := roaring.BitmapOf(0, 3)
|
||||
peer := roaring.BitmapOf(1, 2, 3, 4, 5, 6, 7)
|
||||
|
||||
need := roaring.Xor(roaring.And(have, peer), peer)
|
||||
fmt.Println(need.ToArray())
|
||||
}
|
||||
Reference in new issue
Block a user