Skip to content

UDP Tracker Client: add scrape request #654

@josecelano

Description

@josecelano

Currently, you can use the UDP Tracker client to make an announce request:

cargo run --bin udp_tracker_client 144.126.245.19:6969 9c38422213e30bff212b30c360d26f9a02136422 
    Finished dev [optimized + debuginfo] target(s) in 0.07s
     Running `target/debug/udp_tracker_client '144.126.245.19:6969' 9c38422213e30bff212b30c360d26f9a02136422`
AnnounceIpv4(
    AnnounceResponse {
        transaction_id: TransactionId(
            -888840697,
        ),
        announce_interval: AnnounceInterval(
            300,
        ),
        leechers: NumberOfPeers(
            0,
        ),
        seeders: NumberOfPeers(
            1,
        ),
        peers: [],
    },
)

I'm going to add the scrape so we can also use it in the Tracker Checker.

cargo run --bin udp_tracker_client announce 144.126.245.19:6969 9c38422213e30bff212b30c360d26f9a02136422 
cargo run --bin udp_tracker_client scrape 144.126.245.19:6969 9c38422213e30bff212b30c360d26f9a02136422 

I'm also going to do some refactors.

Subtasks

  • Print JSON instead of debug struct.
  • Use anyhow and clap. See HTTP Tracker client.
  • scrape command.
  • Allow using a domain. Currently, it only allows using an IP.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions