torrent

package
v0.0.0-...-be7ba52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2017 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

magnet to torrent

03621694F0E8B2CE87216C99CB5CA3AF23029E37

||
||  base32(hashinfo+`xxd -r -p`) or
||  base32(StrToBinaryEncode(hashinfo))
\/

ANRBNFHQ5CZM5BZBNSM4WXFDV4RQFHRX

Index

Constants

View Source
const (
	SAMPLE = "magnet:?xt=urn:btih:03621694F0E8B2CE87216C99CB5CA3AF23029E37"
)

Variables

This section is empty.

Functions

func DownLoadTorrentFile

func DownLoadTorrentFile(url, filePath string) int

func InitMagnet

func InitMagnet()

func NewTorrentUrl

func NewTorrentUrl(hashinfo string)

func StrToBinaryEncode

func StrToBinaryEncode(src []byte) string

Types

type FileDict

type FileDict struct {
	Length int64    "length"
	Path   []string "path"
	Md5sum string   "md5sum"
}

type InfoDict

type InfoDict struct {
	FileDuration []int64 "file-duration"
	FileMedia    []int64 "file-media"

	// Single file
	Name   string "name"
	Length int64  "length"
	Md5sum string "md5sum"

	// Multiple files
	Files       []FileDict "files"
	PieceLength int64      "piece length"
	Pieces      string     "pieces"
	Private     int64      "private"
}

type MetaInfo

type MetaInfo struct {
	Info         InfoDict   "info"
	InfoHash     string     "info hash"
	Announce     string     "announce"
	AnnounceList [][]string "announce-list"
	CreationDate int64      "creation date"
	Comment      string     "comment"
	CreatedBy    string     "created by"
	Encoding     string     "encoding"
}

func (*MetaInfo) ReadTorrentMetaInfoFile

func (metaInfo *MetaInfo) ReadTorrentMetaInfoFile(r io.Reader) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL