INNER CODE UNIT · JavaScript

isTorrentFile

webtorrent/instant.io · client/index.js:132

function isTorrentFile (file) {
  const extname = path.extname(file.name).toLowerCase()
  return extname === '.torrent'
}

function isNotTorrentFile (file) {
  return !isTorrentFile(file)
}

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)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…