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-cli.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-cli.ts')
-rw-r--r-- | server/helpers/youtube-dl/youtube-dl-cli.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/youtube-dl/youtube-dl-cli.ts b/server/helpers/youtube-dl/youtube-dl-cli.ts index 508055b85..fc4c40787 100644 --- a/server/helpers/youtube-dl/youtube-dl-cli.ts +++ b/server/helpers/youtube-dl/youtube-dl-cli.ts | |||
@@ -142,6 +142,11 @@ export class YoutubeDLCLI { | |||
142 | }): Promise<{ upload_date: string, webpage_url: string }[]> { | 142 | }): Promise<{ upload_date: string, webpage_url: string }[]> { |
143 | const additionalYoutubeDLArgs = [ '--skip-download', '--playlist-reverse' ] | 143 | const additionalYoutubeDLArgs = [ '--skip-download', '--playlist-reverse' ] |
144 | 144 | ||
145 | if (CONFIG.IMPORT.VIDEOS.HTTP.YOUTUBE_DL_RELEASE.NAME === 'yt-dlp') { | ||
146 | // Optimize listing videos only when using yt-dlp because it is bugged with youtube-dl when fetching a channel | ||
147 | additionalYoutubeDLArgs.push('--flat-playlist') | ||
148 | } | ||
149 | |||
145 | if (options.latestVideosCount !== undefined) { | 150 | if (options.latestVideosCount !== undefined) { |
146 | additionalYoutubeDLArgs.push('--playlist-end', options.latestVideosCount.toString()) | 151 | additionalYoutubeDLArgs.push('--playlist-end', options.latestVideosCount.toString()) |
147 | } | 152 | } |