diff --git a/Download.cs b/Download.cs index 33f6201..d10bcd1 100644 --- a/Download.cs +++ b/Download.cs @@ -68,7 +68,7 @@ public async Task Start() VideoData? videoData = await FetchVideoInfoAsync(ytdl, optionSet); if (null == videoData) return; - outputFilePath = CalculatePath(videoData?.Title, videoData?.UploadDate, videoData.ID); + outputFilePath = CalculatePath(videoData?.Title, videoData?.UploadDate, videoData?.ID); bool downloadSuccess = await DownloadVideoAsync(ytdl, optionSet); if (!downloadSuccess) return; @@ -87,7 +87,8 @@ public async Task Start() Log.Information(outputFilePath); successed = true; } - catch (Exception e) { + catch (Exception e) + { Log.Error("vvvvvvv"); Log.Error(e.Message); Log.Error("^^^^^^^"); @@ -231,7 +232,7 @@ private async Task CutWithFFmpegAsync(string inputPath, strin /// 影片標題,用做檔名 /// 影片日期,用做檔名 /// - private string CalculatePath(string? title, DateTime? date, string videoId) + private string CalculatePath(string? title, DateTime? date, string? videoId) { title ??= ""; // 取代掉檔名中的非法字元 @@ -246,7 +247,7 @@ private string CalculatePath(string? title, DateTime? date, string videoId) date ??= DateTime.Now; - string newPath = Path.Combine(outputDirectory.FullName, $"{date:yyyyMMdd} {title} ({videoId}) [{start}_{end}].mp4"); + string newPath = Path.Combine(outputDirectory.FullName, $"{date:yyyyMMdd} {title} ({videoId ?? id}) [{start}_{end}].mp4"); Log.Debug("Calculate output file path as {newPath}", newPath); return newPath; diff --git a/Form1.cs b/Form1.cs index ddeaecd..fac228a 100644 --- a/Form1.cs +++ b/Form1.cs @@ -92,7 +92,7 @@ private void button_start_Click(object sender, EventArgs e) Settings.Default.Format = format; string browser = comboBox_browser.Text; - if (string.IsNullOrEmpty(browser) + if (string.IsNullOrEmpty(browser) || browser == resources.GetString("comboBox_browser.Items")) { browser = ""; @@ -313,7 +313,7 @@ void SetUI(string id, float start, float end) textBox_end.Text = end.ToString(); } } - catch(Exception ex) + catch (Exception ex) { Log.Error(ex.Message); } diff --git a/Properties/PublishProfiles/ClickOnceProfile.pubxml b/Properties/PublishProfiles/ClickOnceProfile.pubxml index 7e52da9..b49e986 100644 --- a/Properties/PublishProfiles/ClickOnceProfile.pubxml +++ b/Properties/PublishProfiles/ClickOnceProfile.pubxml @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. 0 - 1.7.2.0 + 1.8.0.0 True Release True diff --git a/README.md b/README.md index 409586b..6cb8696 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,14 @@ Input [the format](https://github.com/yt-dlp/yt-dlp#format-selection) such as `3 > Re-encoded is needed after cutting the video. Please read the details below. **I18n 多國語系**\ -我只做了中文介面\ +我做了中文介面\ I only speak Chinese. Give me PR if you make more languages! +**It can accept any yt-dlp supported site.**\ +I only support Youtube, but this application can theoretically be used on [any site supported by yt-dlp](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md).\ +The actual situation depends on the video format and whether ffmpeg can index it correctly, but it's still worth a try.\ +For reference, I have had success with Youtube, Twitch, and niconico. + ## Install Get the latest release