Skip to content

Commit a802b2b

Browse files
committed
Rename yt-dlp on macOS
1 parent fbcf555 commit a802b2b

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

download-third-party-apps.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@ async function main() {
215215
path.join(`${winOrMac}-extra-files`, 'ThirdPartyApps', 'ffmpeg', 'bin', 'ffprobe')
216216
)
217217
console.log('Move successful: ffmpeg and ffprobe')
218+
219+
console.log('Renaming yt-dlp_macos to yt-dlp')
220+
await fsPromises.rename(
221+
path.join(`${winOrMac}-extra-files`, 'ThirdPartyApps', 'yt-dlp', 'yt-dlp_macos'),
222+
path.join(`${winOrMac}-extra-files`, 'ThirdPartyApps', 'yt-dlp', 'yt-dlp')
223+
)
224+
console.log('Rename successful: yt-dlp_macos to yt-dlp')
218225
}
219226
}
220227

main-src/processQueue.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const PATH_TO_YT_DLP = PATH_TO_THIRD_PARTY_APPS
6060
: null
6161
const DEMUCS_EXE_NAME = PATH_TO_THIRD_PARTY_APPS ? 'demucs-cxfreeze' : 'demucs'
6262
const FFMPEG_EXE_NAME = 'ffmpeg'
63-
const YT_DLP_EXE_NAME = process.platform === 'darwin' ? 'yt-dlp_macos' : 'yt-dlp'
63+
const YT_DLP_EXE_NAME = 'yt-dlp'
6464
const CHILD_PROCESS_ENV = {
6565
...process.env,
6666
LANG: null, // Will be set when ready to split, since we can only check system locale after `app` is ready
@@ -195,7 +195,17 @@ export async function deleteYtCacheDir() {
195195
async function downloadYoutube(videoId, downloadPath) {
196196
await createYtCacheDir()
197197
const videoUrl = `https://www.youtube.com/watch?v=${videoId}`
198-
const ytDlpExeArgs = ['-f', 'bestaudio', '--cache-dir', ytCacheDir, '-o', path.basename(downloadPath), '--newline', '--progress', videoUrl]
198+
const ytDlpExeArgs = [
199+
'-f',
200+
'bestaudio',
201+
'--cache-dir',
202+
ytCacheDir,
203+
'-o',
204+
path.basename(downloadPath),
205+
'--newline',
206+
'--progress',
207+
videoUrl,
208+
]
199209
await spawnAndWait(videoId, path.dirname(downloadPath), YT_DLP_EXE_NAME, ytDlpExeArgs, false)
200210
}
201211

0 commit comments

Comments
 (0)