aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/youtube-dl/youtube-dl-wrapper.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-09-07 17:30:21 +0200
committerChocobozzz <me@florianbigard.com>2022-09-08 08:41:48 +0200
commite9fc9e03c120fb048ed00b38157d15144770ec23 (patch)
tree5bea5b738e518527663f17217c92c24fde6620f4 /server/helpers/youtube-dl/youtube-dl-wrapper.ts
parentd4d9bbc6f24522f5d63b0ab105a02f80ca98d702 (diff)
downloadPeerTube-e9fc9e03c120fb048ed00b38157d15144770ec23.tar.gz
PeerTube-e9fc9e03c120fb048ed00b38157d15144770ec23.tar.zst
PeerTube-e9fc9e03c120fb048ed00b38157d15144770ec23.zip
Optimize fetching playlist urls
Diffstat (limited to 'server/helpers/youtube-dl/youtube-dl-wrapper.ts')
-rw-r--r--server/helpers/youtube-dl/youtube-dl-wrapper.ts9
1 files changed, 3 insertions, 6 deletions
diff --git a/server/helpers/youtube-dl/youtube-dl-wrapper.ts b/server/helpers/youtube-dl/youtube-dl-wrapper.ts
index 2c3ba2feb..966b8df78 100644
--- a/server/helpers/youtube-dl/youtube-dl-wrapper.ts
+++ b/server/helpers/youtube-dl/youtube-dl-wrapper.ts
@@ -1,5 +1,6 @@
1import { move, pathExists, readdir, remove } from 'fs-extra' 1import { move, pathExists, readdir, remove } from 'fs-extra'
2import { dirname, join } from 'path' 2import { dirname, join } from 'path'
3import { inspect } from 'util'
3import { CONFIG } from '@server/initializers/config' 4import { CONFIG } from '@server/initializers/config'
4import { isVideoFileExtnameValid } from '../custom-validators/videos' 5import { isVideoFileExtnameValid } from '../custom-validators/videos'
5import { logger, loggerTagsFactory } from '../logger' 6import { logger, loggerTagsFactory } from '../logger'
@@ -59,13 +60,9 @@ class YoutubeDLWrapper {
59 processOptions 60 processOptions
60 }) 61 })
61 62
62 if (!Array.isArray(list)) throw new Error(`YoutubeDL could not get list info from ${this.url}`) 63 if (!Array.isArray(list)) throw new Error(`YoutubeDL could not get list info from ${this.url}: ${inspect(list)}`)
63 64
64 return list.map(info => { 65 return list.map(info => info.webpage_url)
65 const infoBuilder = new YoutubeDLInfoBuilder(info)
66
67 return infoBuilder.getInfo()
68 })
69 } 66 }
70 67
71 async getSubtitles (): Promise<YoutubeDLSubs> { 68 async getSubtitles (): Promise<YoutubeDLSubs> {