module.exports = torrentPoster const captureFrame = require('capture-frame') const path = require('path') function torrentPoster (torrent, cb) { // First, try to use a poster image if available const posterFile = torrent.files.filter(function (file) { return /^poster\.(jpg|png|gif)$/.test(file.name) })[0] if (posterFile) return torrentPosterFromImage(posterFile, torrent, cb) // Second, try to use the largest video file // Filter out file formats that the