diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-21 16:30:47 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-25 10:59:45 +0100 |
commit | d441f2ed78c004e62766394b2437f6089f2b4ca5 (patch) | |
tree | 7666d0b1c3afe1b69d0d00a61809c028bffa834a /server/helpers | |
parent | 66fb2aa39b6f8e4677f80128c27fbafd3a8fe2e7 (diff) | |
download | PeerTube-d441f2ed78c004e62766394b2437f6089f2b4ca5.tar.gz PeerTube-d441f2ed78c004e62766394b2437f6089f2b4ca5.tar.zst PeerTube-d441f2ed78c004e62766394b2437f6089f2b4ca5.zip |
Add disable webtorrent migration
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/webtorrent.ts | 4 |
1 files changed, 3 insertions, 1 deletions
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 | |||
72 | 72 | ||
73 | async function createTorrentAndSetInfoHash (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile) { | 73 | async function createTorrentAndSetInfoHash (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile) { |
74 | const video = extractVideo(videoOrPlaylist) | 74 | const video = extractVideo(videoOrPlaylist) |
75 | const { baseUrlHttp } = video.getBaseUrls() | ||
75 | 76 | ||
76 | const options = { | 77 | const options = { |
77 | // Keep the extname, it's used by the client to stream the file inside a web browser | 78 | // 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 | |||
81 | [ WEBSERVER.WS + '://' + WEBSERVER.HOSTNAME + ':' + WEBSERVER.PORT + '/tracker/socket' ], | 82 | [ WEBSERVER.WS + '://' + WEBSERVER.HOSTNAME + ':' + WEBSERVER.PORT + '/tracker/socket' ], |
82 | [ WEBSERVER.URL + '/tracker/announce' ] | 83 | [ WEBSERVER.URL + '/tracker/announce' ] |
83 | ], | 84 | ], |
84 | urlList: [ WEBSERVER.URL + STATIC_PATHS.WEBSEED + getVideoFilename(videoOrPlaylist, videoFile) ] | 85 | urlList: [ videoOrPlaylist.getVideoFileUrl(videoFile, baseUrlHttp) ] |
85 | } | 86 | } |
86 | 87 | ||
87 | const torrent = await createTorrentPromise(getVideoFilePath(videoOrPlaylist, videoFile), options) | 88 | const torrent = await createTorrentPromise(getVideoFilePath(videoOrPlaylist, videoFile), options) |
@@ -126,6 +127,7 @@ function generateMagnetUri ( | |||
126 | // --------------------------------------------------------------------------- | 127 | // --------------------------------------------------------------------------- |
127 | 128 | ||
128 | export { | 129 | export { |
130 | createTorrentPromise, | ||
129 | createTorrentAndSetInfoHash, | 131 | createTorrentAndSetInfoHash, |
130 | generateMagnetUri, | 132 | generateMagnetUri, |
131 | downloadWebTorrentVideo | 133 | downloadWebTorrentVideo |