7

Sites were you put in a youtube url, then it goes and gives you an mp4 or mp3 of the video.

How does that work?

Viewing the source of a youtube page gives me:

 <video class="video-stream html5-main-video" x-webkit-airplay="allow" data-youtube-id="q9ioaNWaqtw" src="blob:http%3A//www.youtube.com/9a45c6e4-df42-4e8b-9fb3-43a78cccebf3" style="width: 640px; height: 360px; left: 0px; top: 0px; -webkit-transform: none;"></video>

Just going to the src gives you nothing. As an answer, oliver says you can just "simply download them directly". How do those sites do that?

I'm planning to make one. What pieces of information, specifically, should I be targeting?

Is there any sort of open source youtube downloader I can take a look at?

2 Answers2

2

YouTube download websites determine the location of the FLV file that is served through the YouTube player. It essentially reverse engineers the HTML/JavaScript (previously Flash/ActionScript) that serves the video and gets the source.

It then prompts your browser to start downloading that FLV file, or it converts it in the cloud for you to download in the format you want. All of this is being done with VBScript or Visual Basic and Java.

The reason you can't view the source file in the page's source code is because YouTube doesn't serve the file in plaintext HTML, it does it using the video player on the backend.

0

The files are on YouTubes servers. They are just streamed to your client. You could just as well simply download them directly.

The only difference with these sites is, that they're also serving you advertisements.

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311