aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-11-21 16:30:47 +0100
committerChocobozzz <me@florianbigard.com>2019-11-25 10:59:45 +0100
commitd441f2ed78c004e62766394b2437f6089f2b4ca5 (patch)
tree7666d0b1c3afe1b69d0d00a61809c028bffa834a /server/helpers
parent66fb2aa39b6f8e4677f80128c27fbafd3a8fe2e7 (diff)
downloadPeerTube-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.ts4
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
73async function createTorrentAndSetInfoHash (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile) { 73async 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
128export { 129export {
130 createTorrentPromise,
129 createTorrentAndSetInfoHash, 131 createTorrentAndSetInfoHash,
130 generateMagnetUri, 132 generateMagnetUri,
131 downloadWebTorrentVideo 133 downloadWebTorrentVideo