mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 12:11:36 +00:00
standard
This commit is contained in:
parent
3cec3fa7d9
commit
eb69f8d7ab
@ -281,8 +281,8 @@ Client.scrape = (opts, cb) => {
|
||||
|
||||
opts.infoHash = Array.isArray(opts.infoHash)
|
||||
? opts.infoHash.map(infoHash => {
|
||||
return Buffer.from(infoHash, 'hex')
|
||||
})
|
||||
return Buffer.from(infoHash, 'hex')
|
||||
})
|
||||
: Buffer.from(opts.infoHash, 'hex')
|
||||
client.scrape({ infoHash: opts.infoHash })
|
||||
return client
|
||||
|
@ -63,8 +63,8 @@ class HTTPTracker extends Tracker {
|
||||
|
||||
const infoHashes = (Array.isArray(opts.infoHash) && opts.infoHash.length > 0)
|
||||
? opts.infoHash.map(infoHash => {
|
||||
return infoHash.toString('binary')
|
||||
})
|
||||
return infoHash.toString('binary')
|
||||
})
|
||||
: (opts.infoHash && opts.infoHash.toString('binary')) || this.client._infoHashBinary
|
||||
const params = {
|
||||
info_hash: infoHashes
|
||||
|
@ -77,8 +77,8 @@ class WebSocketTracker extends Tracker {
|
||||
|
||||
const infoHashes = (Array.isArray(opts.infoHash) && opts.infoHash.length > 0)
|
||||
? opts.infoHash.map(infoHash => {
|
||||
return infoHash.toString('binary')
|
||||
})
|
||||
return infoHash.toString('binary')
|
||||
})
|
||||
: (opts.infoHash && opts.infoHash.toString('binary')) || this.client._infoHashBinary
|
||||
const params = {
|
||||
action: 'scrape',
|
||||
|
Loading…
Reference in New Issue
Block a user