Skip to content

Commit

Permalink
Учитываем различие название команд для "yt-dlp.exe" и "youtube-dl.exe".
Browse files Browse the repository at this point in the history
  • Loading branch information
v0lt committed Mar 17, 2024
1 parent d4cbd93 commit a61286c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/apps/mplayerc/PlayerYouTubeDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ namespace YoutubeDL

PROCESS_INFORMATION proc_info = {};
CStringW args;
args.Format(LR"(%s -j --all-subs --sub-format vtt --no-check-certificates "%s")", ydl_path.GetString(), url.GetString());
if (ydl_path.Mid(ydl_path.GetLength() - 10).CompareNoCase(L"yt-dlp.exe") == 0) {
// yt-dlp.exe
args.Format(LR"(%s -j --all-subs --sub-format vtt --no-check-certificates "%s")", ydl_path.GetString(), url.GetString());
} else {
// youtube-dl.exe
args.Format(LR"(%s -j --all-subs --sub-format vtt --no-check-certificate "%s")", ydl_path.GetString(), url.GetString());
}

const BOOL bSuccess = CreateProcessW(
nullptr, args.GetBuffer(), nullptr, nullptr, TRUE, 0,
Expand Down

0 comments on commit a61286c

Please sign in to comment.