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
[ 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)
// ---------------------------------------------------------------------------
export {
+ createTorrentPromise,
createTorrentAndSetInfoHash,
generateMagnetUri,
downloadWebTorrentVideo