Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,31 @@ npm run build:renderer
npm start
```

## Build Prerequisites (Linux / macOS)

On Linux or macOS, make sure `yt-dlp` is already installed and available in your `$PATH`.

**Linux:**

Download the binary from [yt-dlp releases](https://github.com/yt-dlp/yt-dlp/releases), make it executable, and place it in your `PATH`:

```bash
chmod +x yt-dlp
sudo mv yt-dlp /usr/local/bin/
```

**macOS:**

```bash
brew install yt-dlp
```

## Build (Linux / macOS)

```bash
npm run build
```

## Build Windows Installer + Portable

```bash
Expand Down
20 changes: 19 additions & 1 deletion electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,15 @@ function isUsableFfmpegBinary(candidatePath) {
}
}

function ensureManagedYtDlpPath() {
function unixManagedYtDlpPath() {
const result = spawnSync("which", ["yt-dlp"]);
if (result.status === 0 && result.stdout) {
return result.stdout.toString().trim();
}
throw new Error("yt-dlp not found in PATH. Please install yt-dlp and ensure it is accessible in your system PATH. See README for installation instructions.");
}

function winManagedYtDlpPath() {
const managedDir = path.join(app.getPath("userData"), "bin");
const managedPath = path.join(managedDir, "yt-dlp.exe");
if (fs.existsSync(managedPath)) {
Expand All @@ -128,6 +136,16 @@ function ensureManagedYtDlpPath() {
return managedPath;
}

function ensureManagedYtDlpPath() {
if (process.platform === "win32") {
return winManagedYtDlpPath();
}
if (process.platform === "linux" || process.platform === "darwin") {
return unixManagedYtDlpPath();
}
throw new Error(`Unsupported platform: ${process.platform}`);
}

function getFfmpegPath() {
const managed = path.join(app.getPath("userData"), "bin", "ffmpeg.exe");
if (isUsableFfmpegBinary(managed)) {
Expand Down
65 changes: 21 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.