Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resumable downloads / seed existing downloads #320

Closed
misterhat opened this issue May 18, 2015 · 24 comments
Closed

Resumable downloads / seed existing downloads #320

misterhat opened this issue May 18, 2015 · 24 comments

Comments

@misterhat
Copy link

@misterhat misterhat commented May 18, 2015

It should be possible to start seeding as soon as a torrent is "downloaded" if the contents are found in the output directory. This is how Transmission works on the CLI. The functionality would be especially useful for webtorrent-hybrid.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented May 18, 2015

Yeah, this makes sense to me. I would accept a PR for this. :) Busy with other issues right now, but I agree this is important.

@madd512

This comment has been minimized.

Copy link

@madd512 madd512 commented Jul 3, 2015

Trying to figure out how to do this, but having a pretty tough time getting started. @feross, could you point me in the right direction?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jul 3, 2015

@devtristan Have you taken a look at lib/storage.js and lib/fs-storage.js?

@feross feross changed the title Seed existing downloads Resumable downloads / seed existing downloads Jul 3, 2015
@madd512

This comment has been minimized.

Copy link

@madd512 madd512 commented Jul 3, 2015

@feross Yeah, I am right now. I saw that a torrent is seeded by loading all of the data into torrent.storage and then... (???)

Maybe I'm wrong about a basic assumption. After client.add, are all files selected or deselected?

@iamtekeste

This comment has been minimized.

Copy link

@iamtekeste iamtekeste commented Aug 11, 2015

+1 for this feature!

@MiracleBlue

This comment has been minimized.

Copy link

@MiracleBlue MiracleBlue commented Aug 14, 2015

+2 for this, I desperately need pause functionality. I'm currently working on just the UI part of my new client, but will probably start the actual data transfer stuff fairly soon. Any takers? Or should I give it a go?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 15, 2015

You should give it a go!

@MiracleBlue

This comment has been minimized.

Copy link

@MiracleBlue MiracleBlue commented Aug 28, 2015

@feross Gonna give it a go tonight and see where I get to :) here's hoping!

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 28, 2015

@MiracleBlue How'd it go?

@MiracleBlue

This comment has been minimized.

Copy link

@MiracleBlue MiracleBlue commented Aug 31, 2015

I struggled with trying to figure out what it takes to actually resume a
partial torrent download (I'm not particularly knowledgible in the Torrent
spec), but I discovered that most clients will do a re-check of the hashes
(or something like that) of the downloaded pieces and determine which
partials are missing, but I was mostly focussed on getting a few of the
last UI bits in to my blue-torrent.

Next weekend I will continue!

On Sat, Aug 29, 2015 at 3:26 AM, Feross Aboukhadijeh <
notifications@github.com> wrote:

@MiracleBlue https://github.com/MiracleBlue How'd it go?


Reply to this email directly or view it on GitHub
#320 (comment).

@MiracleBlue

This comment has been minimized.

Copy link

@MiracleBlue MiracleBlue commented Sep 18, 2015

I haven't forgotten about this. Just finding it hard to find the time. Unfortunately I'm not terribly knowledgable with the Torrent spec, so this is certainly a tricky thing for me :) I'm still working away slowly on my little torrent client which is gonna need this functionality.

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Oct 24, 2015

+1 to seed existing downloads!

@eliooses

This comment has been minimized.

Copy link

@eliooses eliooses commented Nov 4, 2015

+1

@whitef0x0

This comment has been minimized.

Copy link

@whitef0x0 whitef0x0 commented Dec 5, 2015

I just made a PR that fixes the resumable download portion of this issue. #515

@JacopoDaeli

This comment has been minimized.

Copy link

@JacopoDaeli JacopoDaeli commented Feb 18, 2016

Hello @feross any news about this feature? How would you suggest to do it, I may try my chance and open a PR.

@skibulk

This comment has been minimized.

Copy link

@skibulk skibulk commented May 4, 2016

Is this possible in a web browser? Can file pieces persist across sessions and still be accessible? Wouldn't there be file size limitations?

@skibulk

This comment has been minimized.

@whitef0x0

This comment has been minimized.

Copy link

@whitef0x0 whitef0x0 commented May 6, 2016

I already did this. Look at my fork for inspiration

@singpolyma

This comment has been minimized.

Copy link

@singpolyma singpolyma commented Jun 11, 2016

Does this not work now? If I run with --keep-seeding it certainly does not seem to re-download... but maybe it's not really seeding?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Jul 29, 2016

I'm pretty sure this issue can be closed.

It's possible to resume a torrent by calling client.add() with the option { path: '/path/to/torrent/folder' }. If files exist there with the same names as what is in the torrent, then WebTorrent will verify them and check their contents. Whichever pieces are valid, will be preserved and not re-downloaded.

On the command line, you can do the same with webtorrent "magnet_uri" --out /path/to/torrent/folder.

@feross feross closed this Jul 29, 2016
@JacopoDaeli

This comment has been minimized.

Copy link

@JacopoDaeli JacopoDaeli commented Feb 4, 2017

@feross is webtorrent start seeding as soon as it gets the first piece of data?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Feb 5, 2017

@t-mullen

This comment has been minimized.

Copy link

@t-mullen t-mullen commented Dec 15, 2017

How can this be done in the browser?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 30, 2018

@RationalCoding Sorry for the delayed response. There's not a simple API to get this working in the browser yet, but you can call torrent.add(), then later manually call the undocumented torrent.load() with the partial or completely downloaded torrent contents and that will re-populate the storage.

Alternatively, you can use the documented store argument to specify a custom factory function that returns an abstract-chunk-store compliant storage object that you initialize with the needed data. You can see how this is invoked here:

Torrent.prototype.load = function (streams, cb) {

@lock lock bot locked as resolved and limited conversation to collaborators Jul 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.