Go library to parse magnet link into a struct
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Unbewohnte f187461371 Fixed README 3 years ago
LICENSE initial commit 3 years ago
README.md Fixed README 3 years ago
go.mod initial commit 3 years ago
magnetInfo.go initial commit 3 years ago
magnetInfo_test.go initial commit 3 years ago

README.md

magnetInfo

Installation

go get github.com/Unbewohnte/magnetInfo

Usage

package main

import (
	"fmt"
	magnetinfo "magnet-info"
)

func main() {
	info, _ := magnetinfo.Parse("magnet:?xt=urn:btih:83918ea4bb488cefd3d8b8b8762597d32aebb4fa&tr=http%3A%2F%2Facademictorrents.com%2Fannounce.php&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969")

	fmt.Printf("%+v", info)

    // ...
}

Output is

&{DisplayNames:[] ExactLength:0 ExactTopics:[urn:btih:83918ea4bb488cefd3d8b8b8762597d32aebb4fa] WebSeeds:[] AcceptableSources:[] ExactSources:[] KeywordTopics:[] ManifestTopics:[] AddressTrackers:[http://academictorrents.com/announce.php udp://tracker.coppersurfer.tk:6969 udp://tracker.opentrackr.org:1337/announce udp://tracker.leechers-paradise.org:6969]}