From d441f2ed78c004e62766394b2437f6089f2b4ca5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Nov 2019 16:30:47 +0100 Subject: Add disable webtorrent migration --- server/helpers/webtorrent.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/helpers/webtorrent.ts') diff --git a/server/helpers/webtorrent.ts b/server/helpers/webtorrent.ts index f3e41f8d6..3a99518c6 100644 --- a/server/helpers/webtorrent.ts +++ b/server/helpers/webtorrent.ts @@ -72,6 +72,7 @@ async function downloadWebTorrentVideo (target: { magnetUri: string, torrentName async function createTorrentAndSetInfoHash (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile) { const video = extractVideo(videoOrPlaylist) + const { baseUrlHttp } = video.getBaseUrls() const options = { // Keep the extname, it's used by the client to stream the file inside a web browser @@ -81,7 +82,7 @@ async function createTorrentAndSetInfoHash (videoOrPlaylist: MVideo | MStreaming [ WEBSERVER.WS + '://' + WEBSERVER.HOSTNAME + ':' + WEBSERVER.PORT + '/tracker/socket' ], [ WEBSERVER.URL + '/tracker/announce' ] ], - urlList: [ WEBSERVER.URL + STATIC_PATHS.WEBSEED + getVideoFilename(videoOrPlaylist, videoFile) ] + urlList: [ videoOrPlaylist.getVideoFileUrl(videoFile, baseUrlHttp) ] } const torrent = await createTorrentPromise(getVideoFilePath(videoOrPlaylist, videoFile), options) @@ -126,6 +127,7 @@ function generateMagnetUri ( // --------------------------------------------------------------------------- export { + createTorrentPromise, createTorrentAndSetInfoHash, generateMagnetUri, downloadWebTorrentVideo -- cgit v1.2.3