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

Add time remaining estimate and minor fixes #56

Merged
merged 10 commits into from May 18, 2014

Conversation

@transitive-bullshit
Copy link
Member

transitive-bullshit commented May 15, 2014

Also updating Webtorrent.add to match the opts update of Client.add for adding torrent-specific options.

Note: for this PR to be fully functional, it depends on my other PRs to bittorrent-client, bittorrent-tracker, bittorrent-swarm, and ut_metadata.

@transitive-bullshit

This comment has been minimized.

Copy link
Member Author

transitive-bullshit commented May 16, 2014

Note: the last 2 commits add VLC streaming and storing the results of a torrent download to the filesystem. Depends on PR to bittorrent-client.

…n-memory buffer if possible
.
@feross feross merged commit 8021381 into webtorrent:master May 18, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
var path = require('path')
var numeral = require('numeral')
var address = require('network-address')
var moment = require('moment')
var proc = require('child_process')

This comment has been minimized.

Copy link
@feross

feross May 18, 2014

Member

already included as cp

@@ -33,8 +32,12 @@ function usage () {
console.log('')
console.log(' -p, --port change the http port [default: 9000]')
console.log(' -l, --list list available files in torrent')
console.log(' -n, --no-quit do not quit peerflix on vlc exit')

This comment has been minimized.

Copy link
@feross

feross May 18, 2014

Member

lol, webtorrent

This comment has been minimized.

Copy link
@transitive-bullshit

transitive-bullshit May 18, 2014

Author Member

hahahaha, whoops 👍

client.add(torrentId, function (err, torrent) {
client.once('ready', function () {
client.server.once('error', function () {
client.server.listen(0)

This comment has been minimized.

Copy link
@feross

feross May 18, 2014

Member

what's this line for?

This comment has been minimized.

Copy link
@transitive-bullshit

transitive-bullshit May 18, 2014

Author Member

I took it from peerflix; my assumption was that once the http server hits an error, it would close the server by telling it to listen on 0, but I'm not 100% sure that's the actual effect tbh.

This comment has been minimized.

Copy link
@feross

feross May 18, 2014

Member

I think listen(0) actually tells node to listen on a random port.


inherits(WebTorrent, Client)

function WebTorrent (opts) {
var self = this
opts = opts || {}
if (opts.blocklist) opts.blocklist = parseBlocklist(opts.blocklist)

This comment has been minimized.

Copy link
@feross

feross May 18, 2014

Member

tab -> spaces

This comment has been minimized.

Copy link
@transitive-bullshit

transitive-bullshit May 18, 2014

Author Member

good call

@@ -74,14 +89,94 @@ WebTorrent.prototype._onTorrent = function (torrent) {
var self = this

// if no index specified, use largest file
// TODO: support torrent index selection correctly -- this doesn't work yet

This comment has been minimized.

Copy link
@feross

feross May 18, 2014

Member

thanks for adding this!

@feross

This comment has been minimized.

Copy link
Member

feross commented May 18, 2014

👍 👍 👍

var pieceStart = index * pieceLength
var pieceEnd = pieceStart + piece.length

var from = (fileStart < pieceStart) ? 0 : fileStart - pieceStart

This comment has been minimized.

Copy link
@transitive-bullshit

transitive-bullshit May 18, 2014

Author Member

just noticed this is using tabs too

This comment has been minimized.

Copy link
@feross

feross May 18, 2014

Member

will fix

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

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.