mafintosh / torrent-stream

The low level streaming torrent engine that peerflix uses
MIT License
1.94k stars 228 forks source link

use trackers from magnet link when torrent file has none #102

Closed bsuh closed 9 years ago

bsuh commented 9 years ago

This is a rough guess of the cause of the problem I'm running into based on my limited technical knowledge of how torrents work.

DHT isn't working because of firewall problems. I rely on magnet links that I pass to torrent-stream which contain trackers. Sometimes when exchanging metadata with a peer, the torrent saved doesn't contain any trackers (I'm guessing those peers do not use trackers but only DHT for privacy?). So when torrent-stream relies on the saved torrent file, it'll only rely on DHT which doesn't work because of firewall problems.

This is my crude fix. Maybe you would want to merge tracker arrays before saving the torrent file? Or merge tracker arrays before calling ontorrent. You'd know better than I would.

mafintosh commented 9 years ago

Thanks! Made a small tweak to this that sets the trackers as an option instead of mutating the torrent. Released in 0.18.0