The problem is not downloading. The only problem with YouTube is
extracting the URI for downloading from the page where you can watch the video. You
need to search for the recipe on the Web — the trouble is, youtube.com
changes the structure from time to time, so you need to get fresh information, try it out manually, make sure it works right now and then implement it in your code. Make sure it's flexible enough, because you may need to change the algorithm later, so better make it data-driven/rule-driven. The algorithm itself if always trivial: you have a video watching page, then you find some URI or video ID on this page using certain search criteria, extract data on video ID, compose new URI out of this data, and later use this URI for downloading.
Downloading: please see my complete and ready-to-use application. It's important feature is the possibility to continue downloading of the partially downloaded resource. Here:
how to download a file from internet[
^].
For some more information, please see my past answers:
FTP: Download Files[
^],
how to download a file from the server in Asp.net 2.0[
^],
How to get the data from another site[
^],
get specific data from web page[
^].
Conversion:
http://en.wikipedia.org/wiki/Ffmpeg[
^],
http://ffmpeg.org/[
^],
http://en.wikipedia.org/wiki/Libavcodec[
^],
http://libav.org/[
^].
Alternatively:
http://en.wikipedia.org/wiki/VideoLAN[
^],
http://www.videolan.org/[
^].
All the products listed above are open-source, so, you can either use the applications directly (think
System.Process.Start
with redirection on
StandardOutput
/
StandardError
; you will find the samples on the MSDN help pages on this class), embed the code in your code (think P/Invoke or intermediate C++/CLI mixed-mode library, or JNI) or translate the algorithms in the language you want to use.
—SA