From 98ea11ab425da1133a3e0fc54e23b83e7e1809e9 Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sun, 2 Jun 2024 15:32:39 +0100 Subject: [PATCH] fix: re-add WEBTORRENT_ANNOUNCE which is used for adding websocket trackers to magnetURIs which do not already have them. --- lib/global.js | 6 ++++++ package.json | 1 + 2 files changed, 7 insertions(+) diff --git a/lib/global.js b/lib/global.js index e00156d..ba02785 100644 --- a/lib/global.js +++ b/lib/global.js @@ -1 +1,7 @@ +import { announceList } from 'create-torrent' + +globalThis.WEBTORRENT_ANNOUNCE = announceList + .map(arr => arr[0]) + .filter(url => url.indexOf('wss://') === 0 || url.indexOf('ws://') === 0) + console.warn('webtorrent-hybrid: This package is deprecated as of WebTorrent >= 2.3.0 as native WebRTC support has been added to WebTorrent. Please switch to using the "webtorrent" package.') diff --git a/package.json b/package.json index b850286..6f82dda 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ }, "deprecated": "This package is deprecated as of WebTorrent >= 2.3.0 as native WebRTC support has been added to WebTorrent. Please switch to using the \"webtorrent\" package.", "dependencies": { + "create-torrent": "^6.0.17", "webtorrent": "^2.3.0", "webtorrent-cli": "^4.0.0" },