Skip to content

Commit

Permalink
Add DHT logic
Browse files Browse the repository at this point in the history
  • Loading branch information
BoredLama committed Apr 12, 2020
1 parent 448d20a commit fd32213
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ const streamFromMagnet = (tor, uri, type, cb) => {

title += '\r\n' + subtitle

let trackers = (parsed.announce || []).map(x => { return "tracker:"+x })

if (!config.dhtEnabled || config.dhtEnabled == 'True')
trackers = trackers.concat(["dht:"+infoHash])

cb({
name: tor.from,
type: type,
infoHash: infoHash,
sources: (parsed.announce || []).map(x => { return "tracker:"+x }).concat(["dht:"+infoHash]),
sources: trackers,
title: title
})
}
Expand Down

0 comments on commit fd32213

Please sign in to comment.