Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUsing parsed torrent not working correctly #471
Comments
This comment has been minimized.
This comment has been minimized.
|
Did you supply one or more trackers? Without those it won't be able to get peers anywhere except the DHT. |
This comment has been minimized.
This comment has been minimized.
|
Yes I supplied a tracker. Also, maybe I'm just misunderstanding something, but shouldn't the first callback ("got torrent metadata") fire instantly for a parsed torrent? From briefly stepping through the code it seemed like it just took the infoHash and ignored the rest of the data, just fetching everything from the DHT |
This comment has been minimized.
This comment has been minimized.
|
@frankh Did you solve it, can you provide debug logs? https://github.com/feross/webtorrent/blob/master/lib/torrent.js#L288-L289 |
This comment has been minimized.
This comment has been minimized.
Yes, it should fire very fast, but not on the same tick. The 'torrent' event always fires on the next tick to give users a chance to attach event listeners on the event.
That should not happen. It would be a lot easier to debug this issue with a complete code example. Also, to confirm, you're using this in node.js, not the browser, right? |
This comment has been minimized.
This comment has been minimized.
|
@feross This is just because the 'info' property is required. I stumbled upon this issue when creating the BMagnet demo server. If you include Check https://github.com/feross/webtorrent/blob/master/lib/torrent.js#L291-L292 now |
This comment has been minimized.
This comment has been minimized.
|
Ah, right. This is expected behavior if it's not a real "parsed torrent". But I have no idea why he was getting an exception. I don't think "created.getDate()" appears anywhere in the webtorrent code. |
This comment has been minimized.
This comment has been minimized.
|
Re-read the original issue and it is really weird. created.getDate() is only in https://github.com/feross/parse-torrent-file/blob/master/test/encode.js#L13 in the whole webtorrent and its deps tree |
This comment has been minimized.
This comment has been minimized.
|
Yeah, let's close this for now. @frankh If you have more details to share about what triggered this bug, please leave a comment or open a new issue. |
This comment has been minimized.
This comment has been minimized.
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
This raises an error "e.created.getDate()" undefined is not a function. After some digging it turns out that e.created is a date string, so I manually wrapped it in new Date().
It now technically worked, except it seems like it just used the infoHash and created a magnet link. The whole reason I used a parsed torrent was to speed up the download by skipping the magnet step