Skip to content

Commit f7b73aa

Browse files
committed
support ann as announce url
1 parent f4df652 commit f7b73aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/client/http-tracker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Tracker from './tracker.js'
1111
import compact2string from 'compact2string'
1212

1313
const debug = Debug('bittorrent-tracker:http-tracker')
14-
const HTTP_SCRAPE_SUPPORT = /\/(announce)[^/]*$/
14+
const HTTP_SCRAPE_SUPPORT = /(\/ann(?:ounce)?)[^/]*$/
1515

1616
/**
1717
* HTTP torrent tracker client (for an individual tracker)
@@ -32,7 +32,7 @@ class HTTPTracker extends Tracker {
3232
const match = this.announceUrl.match(HTTP_SCRAPE_SUPPORT)
3333
if (match) {
3434
const pre = this.announceUrl.slice(0, match.index)
35-
const post = this.announceUrl.slice(match.index + 9)
35+
const post = this.announceUrl.slice(match.index + match[1].length)
3636
this.scrapeUrl = `${pre}/scrape${post}`
3737
}
3838

0 commit comments

Comments
 (0)