mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-11-26 10:40:28 -06:00
Fix webtorrent crash
See https://github.com/Chocobozzz/PeerTube/issues/6109
This commit is contained in:
parent
ea685879bb
commit
675f219639
@ -80,6 +80,7 @@ describe('Time to int', function () {
|
|||||||
|
|
||||||
expect(timeToInt('5h10m')).to.equal(5 * 3600 + 60 * 10)
|
expect(timeToInt('5h10m')).to.equal(5 * 3600 + 60 * 10)
|
||||||
expect(timeToInt('5h10m0s')).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)
|
expect(timeToInt(3500)).to.equal(3500)
|
||||||
})
|
})
|
||||||
|
@ -36,7 +36,10 @@ async function downloadWebTorrentVideo (target: { uri: string, torrentName?: str
|
|||||||
await ensureDir(directoryPath)
|
await ensureDir(directoryPath)
|
||||||
|
|
||||||
// eslint-disable-next-line new-cap
|
// 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) => {
|
return new Promise<string>((res, rej) => {
|
||||||
let file: TorrentFile
|
let file: TorrentFile
|
||||||
|
Loading…
Reference in New Issue
Block a user