Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd without starting download? #255
Comments
This comment has been minimized.
This comment has been minimized.
|
From the command line you can list the files in a torrent using the $ webtorrent --list "magnet:?xt=urn:btih:a97cf38232f073cbe83c34197437edfd702237c0&dn=Sintel+4k+UHD+ENG+FLAC+ITA+ENG+Sub+DMRip+1744p+X265+ZMachine&xl=3489948077&dl=3489948077"
0 : Sintel.4k.UHD.ENG.FLAC.ITA.ENG.Sub.DMRip.1744p.X265_ZMachine.mkv (3.49 GB)From the API, there's no simple way to do this at the moment, but you can print out the metadata and then remove the torrent from the client. That would do the trick. var WebTorrent = require('webtorrent')
var client = new WebTorrent()
client.add(magnetUri, function (torrent) {
console.log(torrent.parsedTorrent) // or torrent.metadata, torrent.files, etc.
client.remove(torrent)
}) |
This comment has been minimized.
This comment has been minimized.
|
@feross how would I go with getting seeder / leecher list from a set of trackers in an array (or from a parsed torrent) without downloading the torrent? I'm a bit confused on this one. Thanks in advance! |
This comment has been minimized.
This comment has been minimized.
|
How about
That way you wouldn't be downloading any files, but still stay in the swarm, i guess. Would that work? |
This comment has been minimized.
This comment has been minimized.
|
@Svenskunganka Please open a new issue for your question (it has nothing to do with this issue). @alexeisavca You solution would work @btmdave You can do this: client.add(torrentId, function (torrent) {
// gets called once we have the torrent metadata
console.log(torrent.files) // access the metadata, etc.
torrent.destroy()
})The callback is called as soon as the client has the torrent metadata (and before downloading has started), so destroying the torrent immediately will allow you to just access the metadata. |
Is there anyway to add a torrent and get it's info, but not start downloading?