xat / castnow

commandline chromecast player
MIT License
3.81k stars 243 forks source link

support --all option for torrents #68

Open mafintosh opened 9 years ago

mafintosh commented 9 years ago

peerflix can stream back all files in a torrent. would be cool if castnow had an option (or just per default) could add all music and movie files in a torrent to the chromecast playlist.

var server = peerflix(...)

server.engine.on('ready', function () {
  server.engine.files.forEach(function (file, i) {
    if (isMovieOrMusic(file)) {
      playlist.push({name: file.name, url: 'http://myip:8888/'+i})
      file.select() // download the file
    }
  })
})

server.listen(8888)

i'd be happy to do a PR if you'd be interesting in supporting something like this

xat commented 9 years ago

That sounds really cool :)

I'm reworking/refactoring castnow these days so I think this feature should be added directly to the new codebase. In the new codebase I'm using your torrent-stream module directly ( unless you tell me it's a bad idea :D ) ( see https://github.com/xat/castnow/blob/v0.5/plugins/torrent.js ). In the new codebase the playlist stuff is also much better supported than it is now.

I'll flag this feature for the v0.5 milestone and come back to you if I have problems implementing it.

mafintosh commented 9 years ago

using torrent-stream directly gives you more low level access to thats probably a good idea. just checked out your 0.5 code and it looks pretty cool!

just ping me if you need any help.

xat commented 9 years ago

Thanks, I will :)

guegrer commented 9 years ago

so great can't wait to see the result :)