mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 17:59:37 +02:00
Use got instead of request
This commit is contained in:
parent
71926aae07
commit
db4b15f21f
32 changed files with 346 additions and 328 deletions
|
@ -41,7 +41,7 @@ class VideosCaptionCache extends AbstractVideoStaticFileCache <string> {
|
|||
const remoteUrl = videoCaption.getFileUrl(video)
|
||||
const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.filename)
|
||||
|
||||
await doRequestAndSaveToFile({ uri: remoteUrl }, destPath)
|
||||
await doRequestAndSaveToFile(remoteUrl, destPath)
|
||||
|
||||
return { isOwned: false, path: destPath }
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache <string> {
|
|||
const destPath = join(FILES_CACHE.PREVIEWS.DIRECTORY, preview.filename)
|
||||
|
||||
const remoteUrl = preview.getFileUrl(video)
|
||||
await doRequestAndSaveToFile({ uri: remoteUrl }, destPath)
|
||||
await doRequestAndSaveToFile(remoteUrl, destPath)
|
||||
|
||||
logger.debug('Fetched remote preview %s to %s.', remoteUrl, destPath)
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class VideosTorrentCache extends AbstractVideoStaticFileCache <string> {
|
|||
const remoteUrl = file.getRemoteTorrentUrl(video)
|
||||
const destPath = join(FILES_CACHE.TORRENTS.DIRECTORY, file.torrentFilename)
|
||||
|
||||
await doRequestAndSaveToFile({ uri: remoteUrl }, destPath)
|
||||
await doRequestAndSaveToFile(remoteUrl, destPath)
|
||||
|
||||
const downloadName = `${video.name}-${file.resolution}p.torrent`
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue