Skip to content

Commit

Permalink
Remove https from trackers
Browse files Browse the repository at this point in the history
Only relevant for old transmission servers

Issue #221
  • Loading branch information
qu1ck committed Sep 13, 2024
1 parent 01c09bb commit d39746b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rpc/torrent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function getTrackerStatus(torrent: TorrentBase): string {

const portRe = /:\d+$/;
const prefixRe = /^((t|tr|tk|tracker|bt|open|opentracker)\d*)\.[^.]+\.[^.]+$/;
const httpRe = /^https?:\/\//;

function getTorrentMainTracker(t: TorrentBase): string {
if (t.trackerStats.length === 0) return "<No trackers>";
Expand All @@ -89,6 +90,8 @@ function getTorrentMainTracker(t: TorrentBase): string {
if (portMatch != null) host = host.substring(0, portMatch.index);
const prefixMatch = prefixRe.exec(host);
if (prefixMatch != null) host = host.substring(prefixMatch[1].length + 1);
const httpMatch = httpRe.exec(host);
if (httpMatch != null) host = host.substring(httpMatch[0].length);
return host;
}

Expand Down

0 comments on commit d39746b

Please sign in to comment.