ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix webtorrent crash
Chocobozzz675f2196397f
diff --git a/packages/tests/src/server-helpers/core-utils.ts b/packages/tests/src/server-helpers/core-utils.tsindex 627260d6bc..f1e7c72f7d 100644--- a/packages/tests/src/server-helpers/core-utils.ts+++ b/packages/tests/src/server-helpers/core-utils.ts@@ -80,6 +80,7 @@ describe('Time to int', function () {expect(timeToInt('5h10m')).to.equal(5 * 3600 + 60 * 10)expect(timeToInt('5h10m0s')).to.equal(5 * 3600 + 60 * 10)+ expect(timeToInt('5h10m0')).to.equal(5 * 3600 + 60 * 10)expect(timeToInt(3500)).to.equal(3500)})diff --git a/server/core/helpers/webtorrent.ts b/server/core/helpers/webtorrent.tsindex c0ac266447..15d4a832af 100644--- a/server/core/helpers/webtorrent.ts+++ b/server/core/helpers/webtorrent.ts@@ -36,7 +36,10 @@ async function downloadWebTorrentVideo (target: { uri: string, torrentName?: strawait ensureDir(directoryPath)// eslint-disable-next-line new-cap- const webtorrent = new (await import('webtorrent')).default()+ const webtorrent = new (await import('webtorrent')).default({+ natUpnp: false,+ natPmp: false+ } as any)return new Promise<string>((res, rej) => {let file: TorrentFile