Skip to content

Commit

Permalink
fix some bugs & update 2022.11.04
Browse files Browse the repository at this point in the history
  • Loading branch information
Kannagi authored and Kannagi committed Nov 4, 2022
1 parent dffaa30 commit f28edb3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion yt-dlp-gui/App.xaml.cs
Expand Up @@ -6,7 +6,7 @@ namespace yt_dlp_gui {
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application {
public static string CurrentVersion = "2022.10.10";
public static string CurrentVersion = "2022.11.04";
private void Application_Startup(object sender, StartupEventArgs e) {
var args = e.Args.ToList();
LoadPath();
Expand Down
2 changes: 1 addition & 1 deletion yt-dlp-gui/Views/Main.xaml
Expand Up @@ -380,7 +380,7 @@
</Style>
</controls:Icons.Style>
</controls:Icons>
<TextBlock FontSize="10" Grid.Column="1" HorizontalAlignment="Left" Text="{Binding asr, StringFormat={}{0}Hz}"/>
<TextBlock FontSize="10" Grid.Column="1" HorizontalAlignment="Left" Text="{Binding asr, StringFormat={}{0}Hz, TargetNullValue=Unknow}"/>
<TextBlock FontSize="10" Grid.Column="3" Text="{Binding audio_ext}"/>
<TextBlock FontSize="10" Grid.Column="4" Text="{Binding acodec}"/>
<TextBlock FontSize="10" Grid.Column="5" HorizontalAlignment="Right" controls:Filesize.Bytes="{Binding filesize}"/>
Expand Down
9 changes: 3 additions & 6 deletions yt-dlp-gui/Views/Main.xaml.cs
Expand Up @@ -121,7 +121,7 @@ public partial class Main :Window {
var deps = Directory.EnumerateFiles(App.AppPath, "*.exe", SearchOption.AllDirectories).ToList();
deps = deps.Where(x => Path.GetFileName(App.AppExe) != Path.GetFileName(x)).ToList();
var dep_youtubedl = deps.FirstOrDefault(x => Regex.IsMatch(Path.GetFileName(x), @"^youtube-dl\.exe"), "");
var dep_ytdlp = deps.FirstOrDefault(x => Regex.IsMatch(Path.GetFileName(x), @"^yt-dlp(_min|_x86|_x64)?\.exe"), "");
var dep_ytdlp = deps.FirstOrDefault(x => Regex.IsMatch(Path.GetFileName(x), @"^(yt-dlp(_min|_x86|_x64)?|ytdl-patched.*?)\.exe"), "");
var dep_ffmpeg = deps.FirstOrDefault(x => Regex.IsMatch(Path.GetFileName(x), @"^ffmpeg"), "");
var dep_aria2 = deps.FirstOrDefault(x => Regex.IsMatch(Path.GetFileName(x), @"^aria2"), "");
if (!string.IsNullOrWhiteSpace(dep_ytdlp)) {
Expand Down Expand Up @@ -187,7 +187,6 @@ public partial class Main :Window {
Data.Video = JsonConvert.DeserializeObject<Video>(std, new JsonSerializerSettings() {
NullValueHandling = NullValueHandling.Ignore
});
//读取 Formats 与 Thumbnails
{
Data.Formats.LoadFromVideo(Data.Video.formats);
Expand All @@ -210,10 +209,9 @@ public partial class Main :Window {
}
Data.Subtitles.AddRange(subs);
}
//读取 图片
var BestUrl = Data.Thumbnails.LastOrDefault()?.url;
//var ThumbUrl = string.Empty;
if (Web.Head(BestUrl)) {
if (BestUrl != null && Web.Head(BestUrl)) {
Data.Thumbnail = BestUrl;
//ThumbUrl = BestUrl;
} else {
Expand All @@ -228,7 +226,6 @@ public partial class Main :Window {
Data.Thumbnail = ThumbPath;
*/
Data.SelectFormatBest(); //选择
var full = string.Empty;
if (Path.IsPathRooted(Data.Video._filename)) {
Expand All @@ -248,7 +245,7 @@ public partial class Main :Window {
"Cookies are required, Use it?\n",
"yt-dlp-gui",
MessageBoxButtons.YesNo);
if (mb == System.Windows.Forms.DialogResult.Yes) {
Data.NeedCookie = true;
GetInfo();
Expand Down

0 comments on commit f28edb3

Please sign in to comment.