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

seed finished torrents without initial check #1139

Closed
BenmasterTM opened this issue Jun 1, 2017 · 3 comments
Closed

seed finished torrents without initial check #1139

BenmasterTM opened this issue Jun 1, 2017 · 3 comments

Comments

@BenmasterTM
Copy link

@BenmasterTM BenmasterTM commented Jun 1, 2017

What i want to do is "load" into webtorrent finished torrents like actually client.seed(torrentID) make, but preventing the "check" of the torrent, I mean when you load a previous downloaded torrent in the disk, webtorrent run from 0% to 100% like is checking the file. its possible avoid this in some way? Because if I have many many files completed, if I add with client.seed() cause extreme HDD usage untill finish to check all files.

Im not sure what do this proces, if the proces is spliting chunks in memory or something similar, can be an option to store in disk to load faster and dont make the process again every time the client is started?

Other torrent clients like Deluge dont have this problem, if try to put big quantity of linux ISOS, and let finish, then close and open again the program, the "check" process dont happen, but the files are shared correctly (I see the upload rates of all files changing)

@BenmasterTM

This comment has been minimized.

Copy link
Author

@BenmasterTM BenmasterTM commented Jun 1, 2017

after some research i found the way to load the torrent into the client without check the chucks again, its undocumented feature of webtorrent, I found it looking in the webtorrent-desktop client sources:

const torrent = client.add(torrentID, {
    path: path,
    fileModtimes: fileModtimes
})

The "trick" is the fileModtimes variable, its returned by (undocumented) function in torrent objects:

torrent.getFileModtimes(function (err, fileModtimes) {
})

In this way the webtorrent client bypass the checksum of the pieces and load gigabyte files instantly.

@andreapaiola

This comment has been minimized.

Copy link
Contributor

@andreapaiola andreapaiola commented Jul 2, 2017

What value do you assign to fileModtimes?

Can I see your code?

Can I do this in the browser?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 25, 2018

@BenmasterTM Yep, you're correct. This feature isn't documented because the API design is quite terrible and I'd like to improve it before too many people start to use it. In the meantime, feel free to use it as this is this same way that WebTorrent Desktop accomplishes seeding upon restart.

@feross feross closed this Apr 25, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 24, 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
3 participants
You can’t perform that action at this time.