max-mapper / torrent

download torrents with node from the CLI
https://www.npmjs.org/package/torrent
632 stars 78 forks source link

Downloading specific files from a torrent #33

Open finnp opened 9 years ago

finnp commented 9 years ago

Hey,

it would be cool if you could somehow select specific files to download from a torrent.

Like e.g. this archive.org torrent includes several encoding versions in one torrent, but I would like to download just one of them: https://archive.org/download/Time-lapseAstronautPhotographyOfEarthfebruary32012/Time-lapseAstronautPhotographyOfEarthfebruary32012_archive.torrent

Not yeat sure show torrent files work, but maybe it would also be possible to create a module for creating new torrent with only the desired file(s) in it:

torrent-select abc.mpeg < input.torrent > output.torrent

Best, Finn

iamtekeste commented 9 years ago

+1 for this feature.

zoo1 commented 9 years ago

I was thinking of taking on this issue. Is there a specific design I should use for inputting a single file torrent download?

LinusU commented 9 years ago

I wish that torrent only supported reading torrent files from stdin, the usage would be so nice then :)

Personally, I think that I prefer the -f flag. It should support specifying the flag more than once to download multiple files thought.

example

torrent ubuntu-14.04.iso.torrent -f ubuntu-14.04.iso
torrent popular-linux.torrent -f ubuntu-14.04.iso -f debian-wheezy.iso -f fedora-22.iso

Another alternative is to provide a secondary tool. I don't know the torrent file specification well enough to comment on wether that would be a feasible route to take.

example

cat ubuntu-14.04.iso.torrent | torrent-select ubuntu-14.04.iso | torrent
cat popular-linux.torrent | torrent-select ubuntu-14.04.iso debian-wheezy.iso fedora-22.iso | torrent

@maxogden What do you prefer?