Skip to content

Commit

Permalink
Fix: FFmpeg filename changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jim60105 committed Aug 3, 2022
1 parent b7f7806 commit 6ed99f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions ExternalProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public enum DependencyStatus
public static string? YtdlpPath { get; private set; }
public static string? FFmpegPath { get; private set; }

// https://github.com/yt-dlp/FFmpeg-Builds/releases/latest
private const string FFmpegFileName = "ffmpeg-n5.1-latest-win64-gpl-shared-5.1.zip";

internal static async Task DownloadYtdlp()
{
Log.Information("Start downloading yt-dlp...");
Expand Down Expand Up @@ -61,11 +64,11 @@ internal static async Task DownloadFFmpeg()

FFmpegPath = TempDirectory.FullName;
HttpClient client = new();
string ffmpegUrl = @"https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-n5.0-latest-win64-gpl-shared-5.0.zip";
string ffmpegUrl = @$"https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/{FFmpegFileName}";
var response = await client.GetAsync(ffmpegUrl, HttpCompletionOption.ResponseHeadersRead);
Log.Debug("Get response from {FFmpegUrl}", ffmpegUrl);

string archivePath = Path.Combine(FFmpegPath, "ffmpeg-n5.0-latest-win64-gpl-shared-5.0.zip");
string archivePath = Path.Combine(FFmpegPath, FFmpegFileName);
File.Delete(archivePath);

using (FileStream fs = new(archivePath, FileMode.Create))
Expand All @@ -78,7 +81,7 @@ internal static async Task DownloadFFmpeg()
try
{
using ZipArchive archive = ZipArchive.Open(archivePath);
Log.Information("Start unpacking ffmpeg-n5.0-latest-win64-gpl-shared-5.0.zip");
Log.Information("Start unpacking {FFmpegFileName}", FFmpegFileName);

foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory
&& (entry.Key.EndsWith("exe")
Expand Down
2 changes: 1 addition & 1 deletion Properties/PublishProfiles/ClickOnceProfile.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.7.1.0</ApplicationVersion>
<ApplicationVersion>1.7.1.1</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Release</Configuration>
<CreateDesktopShortcut>True</CreateDesktopShortcut>
Expand Down

0 comments on commit 6ed99f8

Please sign in to comment.