diff options
author | Chocobozzz <me@florianbigard.com> | 2022-09-07 17:30:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-09-08 08:41:48 +0200 |
commit | e9fc9e03c120fb048ed00b38157d15144770ec23 (patch) | |
tree | 5bea5b738e518527663f17217c92c24fde6620f4 /server/helpers/youtube-dl/youtube-dl-wrapper.ts | |
parent | d4d9bbc6f24522f5d63b0ab105a02f80ca98d702 (diff) | |
download | PeerTube-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.ts | 9 |
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 @@ | |||
1 | import { move, pathExists, readdir, remove } from 'fs-extra' | 1 | import { move, pathExists, readdir, remove } from 'fs-extra' |
2 | import { dirname, join } from 'path' | 2 | import { dirname, join } from 'path' |
3 | import { inspect } from 'util' | ||
3 | import { CONFIG } from '@server/initializers/config' | 4 | import { CONFIG } from '@server/initializers/config' |
4 | import { isVideoFileExtnameValid } from '../custom-validators/videos' | 5 | import { isVideoFileExtnameValid } from '../custom-validators/videos' |
5 | import { logger, loggerTagsFactory } from '../logger' | 6 | import { 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> { |