Closed HDVinnie closed 4 years ago
Docs also seem to be down.
No, that's not implemented yet. I've added it to my list.
I'll look into the docs issue, thanks.
Now that I'm actually thinking about this, I don't see how this is feasible.
A magnet link doesn't contain the piece hashes that are used to check if a downloaded piece is corrupt. But a torrent file must have these piece hashes to be valid.
The only way to solve this would be to connect to the DHT and download the piece hashes, but that can take forever and would add a huge amount of code.
There are websites that do that for you, but I don't want to make this tool depend on some unknown third party.
Let me know if you have any ideas.
OK, I did some research and there are actually several ways to get the missing information.
The "xs" and "as" parameters specify torrent file download URLs. This should work now:
torf -i 'magnet:?xt=urn:btih:e73108cbd628fee5cf203acdf668c5bf45d07810&xs=http%3A%2F%2Freleases.ubuntu.com%2F18.04%2Fubuntu-18.04.4-live-server-amd64.iso.torrent' -o ubuntu.torrent
It looks like you can download the torrent by changing the announce URL from ".../announce" to ".../file?info_hash=...". I tried hard to find any documentation for this, but I failed. The only source I have is this answer on StackOverflow: https://stackoverflow.com/a/1019588
I don't how widely it's supported, but this works:
torf -i 'magnet:?xt=urn:btih:e73108cbd628fee5cf203acdf668c5bf45d07810&tr=https%3A%2F%2Ftorrent.ubuntu.com%2Fannounce' -o ubuntu.torrent
Any further information would be appreciated.
Downloading from UDP trackers. I don't know if this works as with HTTP trackers. According to the docs, trackers don't even have the "info" section, just it's hash.
Downloading from DHT doesn't look trivial, even with a library. I have to play around and see how this works.
Is this possible with CLI? Only seeing example to make torrent/magnet from existing files.