-function handler (argv) {
- if (argv['gui'] === 'ascii') {
- summon('peerterminal')
- const peerterminal = summon('peerterminal')
- peerterminal([ '--link', videoURL, '--invert', argv['invert'] ])
- } else {
- summon('webtorrent-hybrid')
- const CMD = 'node ' + join(root(), 'node_modules', 'webtorrent-hybrid', 'bin', 'cmd.js')
- const CMDargs = ` --${argv.gui} ` +
- argv['url'].replace('videos/watch', 'download/torrents') +
- `-${argv.resolution}.torrent`
- execSync(CMD + CMDargs)
- }