• Check out world news on HeadLinesList.com
  • Forum registration is now open for public.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue in downloading video from Youtube?
#1
Hi.
I am trying to make a video download application for desktop in dot NET C#.
Now the problem is that following code works fine

WebClient webOne = new WebClient();
string temp1 = " http://www.c-sharpcorner.com/UploadFile/shivprasadk/visual-studio-and-net-tips-and-tricks-15/Media/Tip15.wmv";
webOne.DownloadFile(new Uri(temp1), "video.wmv");

but following doesn't:

temp1="http://www.youtube.com/watch?v=Y_UmWdcTrrc&feature=plcp";
(in this case a 200-400 kilobyte junk file gets downloaded )

difference between the two URLs is obvious, first one contains exact name for file while other seems to be encrypted in some way,...

I was unable to find any solution to the problem so I would highly appreciate a little help here, Thanks.
Reply

Ads

#2
The first is an actual file which is why it works. The second is not. Youtube uses streams from a media server. The token after v= is the video ID, that is passed to the database backend which then retrieves a stream URL, that stream is then fed into the Youtube Video Player which is built in Flash [or the new HTML5 one] either way no "actual file" is downloaded.

Existing youtube downloaders online, connect to Youtube as a web browser does, loads the video page in the background and lets the video stream like it would if you actually watched it, it then buffers the data received by that stream into memory then when the video is complete it wraps the buffered data with a file format and creates a single file for you to download. They don't "crack" the youtube ID and download the file direct, that's not possible.
Reply

Ads

  


Forum Jump:


Browsing: 1 Guest(s)