Skip to content
Merged
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
Binary file modified assets/yt-dlp.exe
Binary file not shown.
Binary file modified assets/yt-dlp_arm64.exe
Binary file not shown.
Binary file modified assets/yt-dlp_linux
Binary file not shown.
Binary file modified assets/yt-dlp_linux_aarch64
Binary file not shown.
Binary file modified assets/yt-dlp_macos
100755 → 100644
Binary file not shown.
154 changes: 69 additions & 85 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rosi",
"version": "3.5.0",
"version": "3.5.1",
"private": true,
"description": "Electron GUI for yt-dlp",
"keywords": [
Expand Down
10 changes: 8 additions & 2 deletions src/main/download/commandBuilders.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import type { DownloadRequestOptions, Settings } from '../../types';
import type { DownloadRequestOptions, GpuDetectionResult, Settings } from '../../types';
import { detectGpu } from '../gpu';

export function resolveVideoEncoder(settings: Settings): string {
export async function resolveVideoEncoder(settings: Settings): Promise<string> {
if (!settings.gpuAcceleration) return 'copy';
if (settings.gpuType === 'nvidia') return 'h264_nvenc';
if (settings.gpuType === 'amd') return 'h264_amf';
if (settings.gpuType === 'intel') return 'h264_qsv';

const detected: GpuDetectionResult = await detectGpu();
if (detected.nvidia) return 'h264_nvenc';
if (detected.amd) return 'h264_amf';
if (detected.intel) return 'h264_qsv';
return 'copy';
}

Expand Down
12 changes: 9 additions & 3 deletions src/main/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function cancelFormats() {
}
}

function runConversion(
async function runConversion(
session: DownloadSession,
downloadedFilePath: string,
effectiveSettings: Settings,
Expand Down Expand Up @@ -222,7 +222,7 @@ function runConversion(

sendProgress(session, `🎬 Converting ${inputFilename} to ${targetFormat.toUpperCase()}...`);

const videoEncoder = resolveVideoEncoder(effectiveSettings);
const videoEncoder = await resolveVideoEncoder(effectiveSettings);
const useGpu = effectiveSettings.gpuAcceleration && videoEncoder !== 'copy';

if (useGpu) {
Expand Down Expand Up @@ -466,7 +466,13 @@ export function startDownload(
}

if (effectiveSettings.convertEnabled) {
runConversion(session, downloadedFilePath, effectiveSettings, ffmpegCommand, mainWindow);
void runConversion(
session,
downloadedFilePath,
effectiveSettings,
ffmpegCommand,
mainWindow
);
} else {
sendProgress(session, 'ℹ️ Conversion not enabled for this download.');
completeSession(session, '✅ Download complete (no conversion).');
Expand Down
4 changes: 2 additions & 2 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
fetchFormats,
cancelFormats,
} from './downloader';
import { isSafeExternalUrl, isAllowedNavigationUrl } from '../utils/validation';
import { isSafeExternalUrl, isSafeHttpUrl, isAllowedNavigationUrl } from '../utils/validation';
import {
errorResult,
okResult,
Expand Down Expand Up @@ -222,7 +222,7 @@ ipcMain.handle('select-download-location', async () => {
});

ipcMain.handle('getFormats', (_, url) => {
if (typeof url !== 'string') {
if (typeof url !== 'string' || !isSafeHttpUrl(url)) {
return Promise.reject('Invalid URL provided');
}
return fetchFormats(ytdlpPath, url);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,6 @@ <h1 class="app-title">ROSI</h1>
<div class="loading-bar"></div>
</div>
</div>
<div class="version" id="version-display">v3.5.0</div>
<div class="version" id="version-display">v3.5.1</div>
</body>
</html>
Loading
Loading