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

Torrent added, but download not initiated #1106

Closed
tiagommferreira opened this issue Apr 18, 2017 · 1 comment
Closed

Torrent added, but download not initiated #1106

tiagommferreira opened this issue Apr 18, 2017 · 1 comment

Comments

@tiagommferreira
Copy link

@tiagommferreira tiagommferreira commented Apr 18, 2017

What version of WebTorrent?
0.98.18

What operating system and Node.js version?
Ubuntu 16.04.2 LTS
Node.js v7.9.0

What did you expect to happen?
I have a simple React component that when a user clicks on a button, downloads a set torrent.

import React from 'react';
import WebTorrent from 'webtorrent';
let client = new WebTorrent()
let magnetURI = 'magnet:?xt=urn:btih:69656f3eb368749d31096b842502b574a33fe1a5&dn=13.Reasons.Why.S01E11.WEB.X264-FLATULENCE%5Bettv%5D&xl=545484098&tr=udp://tracker.coppersurfer.tk:6969/announce&tr=udp://tracker.opentrackr.org:1337/announce'

export default class About extends React.Component {
    download() {
        console.log('On Download')
        client.add(magnetURI, function (torrent) {
            // Got torrent metadata!
            console.log('Client is downloading:', torrent.infoHash)

            // Print out progress every 5 seconds
            var interval = setInterval(function () {
                console.log('Progress: ' + (torrent.progress * 100).toFixed(1) + '%')
            }, 5000)

            torrent.on('done', function () {
                console.log('Progress: 100%')
                clearInterval(interval)
            })
        })
    }

    render() {
        return(
            <div>
                <button onClick={this.download.bind(this)}>Download torrent</button>
                <div>About page</div>
            </div>
        );
    }
};

I expected the client to fetch the torrent, execute the callback on the add function, and download the torrent.

What actually happened?
The torrent is added to the client (if I print the client object, the torrent is in the torrents array) but the callback code does not execute and the torrent is not downloaded.

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Apr 18, 2017

The torrent must be seeded by WebRTC peers to work in the browser. Please read the FAQ.

Also, we do not support any type of copyright infringement, please do not use WebTorrent for that or seek support in here for such practice.

@webtorrent webtorrent locked and limited conversation to collaborators Apr 18, 2017
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
2 participants
You can’t perform that action at this time.