INNER CODE UNIT · JavaScript
downloadTorrent
webtorrent/instant.io · client/index.js:141
function downloadTorrent (torrentId) {
const disallowed = DISALLOWED.some(function (infoHash) {
return torrentId.indexOf(infoHash) >= 0
})
if (disallowed) {
util.log('File not found ' + torrentId)
} else {
util.log('Downloading torrent from ' + torrentId)
getClient(function (err, client) {
if (err) return util.error(err)
client.add(torrentId, onTorrent)
})
}
}
function downloadTorrentFile (file) {
util.unsafeLog('Downloading torrent from <strong>' + escapeHtml(file.name) + '</strong>')