Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3718

Downloading video from Youtube using WebClient

$
0
0

I am trying to download Youtube Video from embed url using WebClient (videos only channel owner allowed me).

Here is an example from StackOverflow's youtube channel (https://www.youtube.com/embed/HJtJXMKpl2g)

But the problems starts here. I use the code below to download some img or mp4 files normally in C#.

using (WebClient wc = new WebClient()){    wc.DownloadFileAsync(        new System.Uri("https://www.youtube.com/embed/HJtJXMKpl2g"),"C:\\YoutubeTest\\yttestvideo.mp4"    );}

It actually downloads some file (probably broken cuz file is 87 KB.) however it gives me error when I run it.

Windows Media Player cannot play. The player may not support the file content or the codec used to compress its files.

So is it possible to download a video from this link using WebClient or is there any option to download it from C# side?

Note: I am not seeking a library etc.


Viewing all articles
Browse latest Browse all 3718

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>