package main
import (
"context"
"fmt"
"os"
"time"
"github.com/odwrtw/tpb"
)
func main() {
if err := run(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func run() error {
// The client supports multiple endpoints and will try to use one that
// works
client := tpb.New(
"https://thepiratebay.org",
"https://mypirate.cc",
"https://piratebay.life",
)
// You can create a context to cancel the search
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
defer cancel()
// You can add search options or nil for the default options
torrents, err := client.Search(ctx, "Ubuntu", nil)
if err != nil {
return err
}
for _, t := range torrents {
fmt.Println("--------------")
fmt.Printf("%s\nUploaded by %q (%d seeders / %d leechers)\n",
t.Name,
t.User,
t.Seeders,
t.Leechers,
)
}
return nil
}
forked from odwrtw/tpb
-
Notifications
You must be signed in to change notification settings - Fork 0
PouuleT/tpb
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
thepiratebay scrapper written in go
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Go 100.0%