Closed AndreZila01 closed 3 years ago
I am Creating an Youtube to MP4 Downloader for Windows in .Net framework / C#. I am using the VideoLibrary to download the Video.
I use code the download, and use File.WriteAllBytes, and when i open the video I dont listenning the music of video.
My code:
private async void DownloadVideo() { string downloadUri; String link = TxtUrl.Text; if (TxtUrl.Text.Contains("youtu.be/")) { string[] dss = TxtUrl.Text.Split(new string[] { "youtu.be/" }, StringSplitOptions.None); string dsss = dss[0] + "youtube.com/watch?v=" + dss[1]; link = dsss; } var videoInfos = await cli.GetAllVideosAsync(link); try { TxtUrl.Text = link; var downloadInfo = videoInfos.Where(i => i.Format == VideoFormat.Mp4 && i.Resolution == int.Parse(cboResolucao.Text)).FirstOrDefault(); // if 720p is possible downloadUri = downloadInfo.Uri; File.WriteAllBytes(textBox1.Text + @"\" + downloadInfo.FullName, downloadInfo.GetBytes()/*await downloadInfo.GetBytesAsync()*/); FULLname = downloadInfo.FullName; FULLname = FULLname.Replace(".mp4", ""); } }
Thanks for your help!!
720p and above res has no sound.
Cannot worked, if I use 720p or 360p. I try convert mp4 and mp3, and dont work.
I am Creating an Youtube to MP4 Downloader for Windows in .Net framework / C#. I am using the VideoLibrary to download the Video.
I use code the download, and use File.WriteAllBytes, and when i open the video I dont listenning the music of video.
My code:
Thanks for your help!!