Skip to content

Commit b3de415

Browse files
committed
Fix
1 parent 6e60e92 commit b3de415

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/electron/VideoProcessor.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class VideoProcessor {
132132

133133
// Initialize youtube-dl-exec
134134
if (app.isPackaged) {
135-
const binaryPath = path.join(
135+
const fullBinaryPath = path.join(
136136
__dirname,
137137
"..",
138138
"..",
@@ -142,7 +142,12 @@ export class VideoProcessor {
142142
"bin",
143143
process.platform === "win32" ? "yt-dlp.exe" : process.platform === "darwin" ? "yt-dlp_macos" : "yt-dlp"
144144
);
145-
this.ytInst = youtubedl.create(`"${binaryPath}"`);
145+
const binaryDir = path.dirname(fullBinaryPath);
146+
const binaryName = `.${path.sep}${path.basename(fullBinaryPath)}`;
147+
const rawYt = youtubedl.create(binaryName);
148+
this.ytInst = (url, flags, options) => {
149+
return rawYt(url, flags, { cwd: binaryDir, ...options });
150+
};
146151
} else {
147152
this.ytInst = youtubedl;
148153
}

0 commit comments

Comments
 (0)