anacrolix / confluence

Torrent client as a HTTP service
Mozilla Public License 2.0
236 stars 32 forks source link

How to get path of each file in the torrent? #27

Closed chaos369 closed 3 years ago

chaos369 commented 3 years ago

According to the interface, the path parameter is needed to get the actual data. Is there any way to list the files in a infohash? How to parse the result of /info?ih= ?

GET /data?ih=&path=.

anacrolix commented 3 years ago

The contents of an info are per https://pkg.go.dev/github.com/anacrolix/torrent@v1.20.0/metainfo#Info, which can be unmarshalled with https://pkg.go.dev/github.com/anacrolix/torrent@v1.20.0/bencode.

chaos369 commented 3 years ago

Got it.