Skip to content

Commit

Permalink
Small Tweaks Release
Browse files Browse the repository at this point in the history
  • Loading branch information
theasern committed Oct 18, 2018
1 parent 90d2dc1 commit 7013bb1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 4 deletions.
32 changes: 30 additions & 2 deletions YTDownloader/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions YTDownloader/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using VideoLibrary;
using MediaToolkit;
using MediaToolkit.Model;
using System.Diagnostics;

namespace YTDownloader
{
Expand Down Expand Up @@ -47,7 +48,13 @@ public void button2_Click(object sender, EventArgs e)
var youTube = YouTube.Default;
var video = youTube.GetVideo(link);
File.WriteAllBytes(path + @"\" + video.FullName, video.GetBytes());
MessageBox.Show("Downloaded!");

if (checkBox1.Checked)
{
Process.Start(path);
Environment.Exit(1);
}
else MessageBox.Show("Downloaded!");
}
else MessageBox.Show("Please connect to a network");
}
Expand Down Expand Up @@ -78,10 +85,22 @@ private void button3_Click(object sender, EventArgs e)
engine.GetMetadata(inputFile);
engine.Convert(inputFile, outputFile);
File.Delete(mp4filepath);
MessageBox.Show("Downloaded!");

if (checkBox1.Checked)
{
Process.Start(path);
Environment.Exit(1);
}
else MessageBox.Show("Downloaded!");
}
}

}

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("https://github.com/theasern");
}

}
}

0 comments on commit 7013bb1

Please sign in to comment.