This is a zero external dependencies magnet link parser that can be used to extract information from magnet links and create magnet links.
go get github.com/roarc0/go-magnet
package main
import (
"fmt"
"github.com/roarc0/go-magnet"
)
func main() {
magnet, err := magnet.Parse("magnet:?...")
if err != nil {
fmt.Println(err)
return
}
fmt.Println(magnet)
// Back to a string
fmt.Println(magnet.String())
}
The MIT License (MIT). Please see License File for more information.