Skip to content

Commit

Permalink
v1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jim60105 committed Sep 12, 2022
1 parent c2394c3 commit 1efcecf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
9 changes: 5 additions & 4 deletions Download.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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("^^^^^^^");
Expand Down Expand Up @@ -231,7 +232,7 @@ private async Task<IConversionResult> CutWithFFmpegAsync(string inputPath, strin
/// <param name="title">影片標題,用做檔名</param>
/// <param name="date">影片日期,用做檔名</param>
/// <returns></returns>
private string CalculatePath(string? title, DateTime? date, string videoId)
private string CalculatePath(string? title, DateTime? date, string? videoId)
{
title ??= "";
// 取代掉檔名中的非法字元
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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);
}
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.2.0</ApplicationVersion>
<ApplicationVersion>1.8.0.0</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Release</Configuration>
<CreateDesktopShortcut>True</CreateDesktopShortcut>
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1efcecf

Please sign in to comment.