tags:

views:

35

answers:

3

How can i download the video from server source through C#?

this is the video www.youtube.com/watch?v=UZS0eX8Fe7U&feature=fvhl

and this is the server source of this video http://s.ytimg.com/yt/swf/watch_as3-vflPDfEzH.swf

I apply same procedure for images and easily download from server

A: 

You could use WebClient to download pages:

using (var client = new WebClient())
{
    client.DownloadFile("http://foo.com/somefile", @"c:\somefile");
}

Also notice that what you've provided is not the address of the video file. It is the address of the player. AFAIK the policy forbids downloading the video files from youtube but if you have the address of the video file simply pass it to the DownloadFile method.

Darin Dimitrov
thanks for reply.
Rizwan Ahmed
Rizwan Ahmed
System.Net.WebClient client = new System.Net.WebClient(); byte[] bytedata = client.DownloadData("http://www.youtube.com/watch?v=UZS0eX8Fe7U client.DownloadFile("http://www.youtube.com/watch?v=UZS0eX8Fe7U
Rizwan Ahmed
this get an error An exception occurred during a WebClient request.
Rizwan Ahmed
A: 

This is not a youtube video file, its a youtube video player. Video is returned by /get_video? ...

cichy
A: 

If you just want to download that movie get something like DownloadHelper for FireFox. If you are trying to download any movie from youtube then use code like Darin suggeseted.

Eric Anastas