Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Go library to scrape torrents on any UDP tracker

License

NotificationsYou must be signed in to change notification settings

etix/goscrape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This library partially implementBEP-0015and returns the number ofseeders,leechers andcompleted downloads for a given infohash list.

Usage:

go get -u github.com/etix/goscrape

Example:

// Create a new instance of the library and specify the torrent tracker to use.s,err:=goscrape.New("udp://tracker.kali.org:6969/announce")iferr!=nil {log.Fatal("Error:",err)}// A list of infohash to scrape, at most 74 infohash can be scraped at once.// Be sure to provide infohash that are 40 hexadecimal characters long only.infohash:= [][]byte{    []byte("176e2a9696092482d4acdef445b53ffcebb56960"),    []byte("e80cb87fbd938f3b1e47db64c10c3ab04ad49987"),    []byte("04098e49061bedb3f2d8f90204bf239019d198d9"),}// Connect to the tracker and scrape the list of infohash in only two UDP round trips.res,err:=s.Scrape(infohash...)iferr!=nil {log.Fatal("Error:",err)}// Loop over the results and print them.// Result are guaranteed to be in the same order they were requested.for_,r:=rangeres {fmt.Println("Infohash:\t",string(r.Infohash))fmt.Println("Seeders:\t",r.Seeders)fmt.Println("Leechers:\t",r.Leechers)fmt.Println("Completed:\t",r.Completed)fmt.Println("")}

Result:

Infohash:        176e2a9696092482d4acdef445b53ffcebb56960Seeders:         3053Leechers:        248Completed:       44171Infohash:        e80cb87fbd938f3b1e47db64c10c3ab04ad49987Seeders:         376Leechers:        20Completed:       4161Infohash:        04098e49061bedb3f2d8f90204bf239019d198d9Seeders:         100Leechers:        6Completed:       703

About

Go library to scrape torrents on any UDP tracker

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp