To be clear, I am not trying to actually download the contents of the torrent. I just want to find out what files are IN the torrent (from its magnet link) so I can make sure it doesn't contain bogus spyware or such.
I need a bit of PHP code that takes in a magnet link (ie, "magnet:?xt=urn:btih:12cb31ae6fd4624fe6be48.....")
And what I'm looking to do is get back the list of files (or all the metadata) that are in that torrent. But I can't even get as far as downloading the contents of the torrent file from the magnet link.
I have code that converts a full magnet URI into something like this:
Array
(
[xt] => urn:btih:12cb31ae6fd4624fe6be485c...
[dn] => Son.of.a.Critch.S0...
[tr] => Array
(
[0] => udp://example:80/announce
[1] => udp://example2:6969/announce
[2] => udp://example3.is:6969/announce
)
)
But from here, how do I actually retrieve the torrent's file list and/or metadata?
EDIT: It was suggested this q/a might help: How to pull the torrent file from DHT? but that does not address what I am asking in this question, nor does it take into account PHP in any way. The accepted answer is just "you'll need to implement all the technical details." I am hoping to find out exactly HOW to do that, preferably in PHP, and preferably with something which has already been written.